Blocking Data Entry

PaulJK

Registered User.
Local time
Today, 00:53
Joined
Jul 4, 2002
Messages
60
Sales information can be added against a customer record. What I would like to achieve is for users to still be able to record new sales information, but historical sales information (e.g. before 2007) can be viewed but not be able to be edited or changed. Is there a way of achieving this.
Thanks in advance...Paul
 
Sales information can be added against a customer record. What I would like to achieve is for users to still be able to record new sales information, but historical sales information (e.g. before 2007) can be viewed but not be able to be edited or changed. Is there a way of achieving this.
Make sure your users are using FORMS to access the data and then you can just set the AllowEdits property of the form to NO.
 
Thanks Bob for the reply. The users are using forms however what I was struggling with was the cut off date. Using the same form I would like users to enter sales information for 2008 onwards, but can only view sales data (and not edit) for 2007 or earlier?
Any guidance would be appreciated...Paul
 
Create a table with a single field and value - the cutoff date. Then, create a small, hidden form that you open when the database opens and have it bound to that table. That way the cutoff date will be exposed during the life of your database. (and I say use a table so you can set your own cutoff date but if you ever want to look at other data you, yourself, can go change it quickly to get that data in your queries.

Then, in the On Current event of the form, use:

Code:
If Forms!YourHiddenFormNameHere.YourHiddenFormTextBoxNameHere < Date Then
   Me.AllowEdits = False
Else
   Me.AllowEdits = True
End If
That way they can edit the current records but not previous to the cutoff.
 

Users who are viewing this thread

Back
Top Bottom