From: Haggr1 via AccessMonster.com on
how can I make a record non editable if it is "older" than last Thursday

--
Message posted via http://www.accessmonster.com

From: Jeff Boyce on
Given that someone with a way to fiddle in the tables can change anything,
any time, to be absolutely certain, you'd need to either use Access security
or have your data in a more secure back-end (e.g., SQL Server).

If you're asking how to prevent changes to a record displayed in a form if
that record is older than (?!5 days ago; ?! Thursday, March 11; ???), you
can do that.

We need a bit more specific description to offer more specific
suggestions...

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Haggr1 via AccessMonster.com" <u35393(a)uwe> wrote in message
news:a51c19496d209(a)uwe...
> how can I make a record non editable if it is "older" than last Thursday
>
> --
> Message posted via http://www.accessmonster.com
>


From: fredg on
On Tue, 16 Mar 2010 20:29:31 GMT, Haggr1 via AccessMonster.com wrote:

> how can I make a record non editable if it is "older" than last Thursday

I assume you wish the 'older' date to change each day.
Code the form's Current event:

If Not Me.NewRecord Then
Me.AllowEdits = Me.ADate >= Date - n
Else
Me.AllowEdits = True
End If

where n is the number of days back you wish to use.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
From: Haggr1 via AccessMonster.com on
can this be done is the [Table] parameters. I have multiple forms that use
this table. Below is a fucntion I use to find records between Thursday and
Wednesday.

Function LastThurs() As Date
'This will find last Thursday's date
Dim strDates As Date
Dim intDay As Integer
intDay = Weekday(Date) 'Finds today's day of the week
Select Case intDay
Case 1 'Sunday!
strDates = Date - 3
Case 2 'Monday
strDates = Date - 4
Case 3 'Tuesday
strDates = Date - 5
Case 4 'Wednesday
strDates = Date - 6
Case 5 'Thursday
strDates = Date
Case 6 'Friday
strDates = Date - 1
Case 7 'Saturday
strDates = Date - 2
End Select
LastThurs = strDates
End Function


fredg wrote:
>> how can I make a record non editable if it is "older" than last Thursday
>
>I assume you wish the 'older' date to change each day.
>Code the form's Current event:
>
>If Not Me.NewRecord Then
> Me.AllowEdits = Me.ADate >= Date - n
>Else
> Me.AllowEdits = True
>End If
>
>where n is the number of days back you wish to use.
>

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1

From: Haggr1 via AccessMonster.com on
Can this code be added to the Table somehow. If so, where?

If [Table1].[Date From] < LatsThurs () = True Then
[Table1].[Date From].Allow Edits = No
[Table1].[Date From].AllowDeletions = No
Else
[Table1].[Date From].Allow Edits = Yes
[Table1].[Date From].AllowDeletions = Yes
End If

LastThurs () is as follows:

Function LastThurs() As Date
> 'This will find last Thursday's date
> Dim strDates As Date
> Dim intDay As Integer
> intDay = Weekday(Date) 'Finds today's day of the week
> Select Case intDay
> Case 1 'Sunday!
> strDates = Date - 3
> Case 2 'Monday
> strDates = Date - 4
> Case 3 'Tuesday
> strDates = Date - 5
> Case 4 'Wednesday
> strDates = Date - 6
> Case 5 'Thursday
> strDates = Date
> Case 6 'Friday
> strDates = Date - 1
> Case 7 'Saturday
> strDates = Date - 2
> End Select
> LastThurs = strDates
>End Function



Haggr1 wrote:
>can this be done is the [Table] parameters. I have multiple forms that use
>this table. Below is a fucntion I use to find records between Thursday and
>Wednesday.
>
>Function LastThurs() As Date
> 'This will find last Thursday's date
> Dim strDates As Date
> Dim intDay As Integer
> intDay = Weekday(Date) 'Finds today's day of the week
> Select Case intDay
> Case 1 'Sunday!
> strDates = Date - 3
> Case 2 'Monday
> strDates = Date - 4
> Case 3 'Tuesday
> strDates = Date - 5
> Case 4 'Wednesday
> strDates = Date - 6
> Case 5 'Thursday
> strDates = Date
> Case 6 'Friday
> strDates = Date - 1
> Case 7 'Saturday
> strDates = Date - 2
> End Select
> LastThurs = strDates
>End Function
>
>>> how can I make a record non editable if it is "older" than last Thursday
>>
>[quoted text clipped - 8 lines]
>>
>>where n is the number of days back you wish to use.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1