-----Original Message-----
If I read your post correctly, then you would want to put some code behind
the "on current" event. This code would fire as you moved from one record
to the next.
The code would need to look at your 'date' field and determin if 7 days had
passed. Basically, is the 'date' plus 7 less than or equal to today. If
not, then lock the form from edits.
Maybe something like this...
Private Sub Form_Current()
If [SomeDateField] + 6 <Date() Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If
End Sub
Hope that helps,
Rick B
Cheers Rick, i guess i dont really need any passwords, i
just need to set it up so that no-one can edit the form
for the next seven days from todays date. I need to lock
them out but they need to be able to view the form in read
only for these days. I have hidden and locked all tables
and queries and no-one is computer literate enough to get
around this. Any ideas?
-----Original Message-----
Why a password? If only certain users are allowed to do this, simply build
an "IF" statement in your code that looks at the userid of the person signed
on and either lets them, or does not let them proceed.
A password must be stored somewhere, or referenced in your code and is too
easy to get around.
Of course, depending on how your datbase is set up, your users could easily
just open the table directly and get around any of this anyway. Unless they
have no access to your tables, and your forms are based on queries with the
"run with owner's permission" options, then your users will be able to
easily get around any code you would build.
Rick B
Hi, (my sincere apologies for re-posting)
I have a calendar control on my form that is bound to a
text box that displays the date on the calendar. I need to
be able to set up the calendar or the text box so that if
a user selects a date within teh next 7 days only, it
prompts for a password in order to proceed as normal (i.e
access or create a new record). Any ideas?
Thanks in advance
.
.