Locking records in the past

jonman03

Registered User.
Local time
Today, 09:48
Joined
Nov 5, 2009
Messages
31
Hey everyone,

I have a database that users use monthly for some financial reporting, I'm trying to prevent users who use the database from going back and editing data for previous months. (Ex: going back to January to edit data when it is March)

The database is based off of 1 table. I was hoping that I could just filter the table for the month/year I wish to lock and lock down those records. Is this possible? If not, any other solutions?

Thank you all!
 
One approach, add a Boolean field to the table for determining if the record can be edited. Another approach, if the record is older than a certain date, the record can be defined as not available for editing.

With either approach, you can use the forms "current" event to set "allow edits = No" or "allow edits = yes".
Please read the "allow edits" in Access Help: "You can use the AllowEdits property to prevent changes to existing data displayed by a form. If you want to prevent changes to data in a specific control, use the Enabled or Locked property." I tend to set each control separately with the "locked" property rather than "allow edits".

As an added detail, when I close a control to editing I gray out the control to make it clear that it can NOT be edited. You could also add a label that simply says that the form is closed editing too.
 
Last edited:
the simplist way is to add another field call recordlocked as a tick box
on the form have the properties as visiable =false
then every month run an update qry toset this to true

then have on your form if recordlocked = true
fieldname.enable=false


example
this is on the forms (on currecnt and after update)

If Me.RecZlocked = True Then
Me.Billingaccountname.Enabled = False
Me.Refresh
End If

just missed steve post
If Me.RecZlocked = False Then
Me.Billingaccountname.Enabled = True
End If
you can see but you cannot do anything
 
And you can't do anything if people have direct access to the table; from a form - yes, from the table - no.
 
Ok Thank you all, I'll try these out.

And no, they only have access to the table via a form, not direct table access.
 

Users who are viewing this thread

Back
Top Bottom