Question lock records - date field

antonyx

Arsenal Supporter
Local time
Today, 06:36
Joined
Jan 7, 2005
Messages
556
hello everyone, it has been a while, hope you are all keeping well and sticking to your new year's resolutions (get your ass down the gym!)


i want to lock all records in my job table that have a date value (in my JobDate field) before 2009 (ie 2008, 2007. 2006 etc), i want them to be view only.

can this be done easily in the actual table design view?

thanks
 
I can't think of a way in table design. You could set the Allow Edits property of a form as appropriate in the current event.
 
so what code should i place in the Form's OnCurrent event?

does it allow you to select something or would i need to hard write the code, sorry i cant try, i dont have access to the database for the next hour or two
 
Something along the lines of

Code:
If Me.YourDateField < #1/1/2009# Then
  Me.AllowEdits = False
Else
  Me.AllowEdits = True
End If
 
hi, that is great, very straightforward.

what i would prefer however is if any fields get changed (or attempt to be changed) a message alert appears.

i know the format for creating a message alert, but what event would it be under.. is there a form wide on change (ie if anything on the form gets changed or is clicked)

thanks
 
That's a different question; the form update events would fire if the user changed anything, as would the dirty event. I don't think any form-wide event would fire if they just click in a control.
 

Users who are viewing this thread

Back
Top Bottom