Lock Field After Update

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello...
Ok...I have a checkbox [Active] which when checked automatically enters the
current date/time into another control/field [Date_On]. What I am looking for
is a way to lock the field [Date_On] when the [Active] checkbox is checked
and/or the record is saved.

Any ideas would be greatly appreciated. I thank you in advacnce for your
time.
 
Randy said:
Hello...
Ok...I have a checkbox [Active] which when checked automatically
enters the current date/time into another control/field [Date_On].
What I am looking for is a way to lock the field [Date_On] when the
[Active] checkbox is checked and/or the record is saved.

Any ideas would be greatly appreciated. I thank you in advacnce for
your time.

How secure does it need to be? As long as you keep your users limited
to using forms to access the data, then you could hide that field or change
the properties for it .
 
On the AfterUpdate event of the check box run the code

If Nz(Me.[Active],False) = True Then
Me.[Date_On]=Now()
Me.[Date_On].Locked = True
Else
Me.[Date_On].Locked=False
End If

If you move between records, then use the OnCurrent event of the form to
lock the Date_On field

Me.[Date_On].Locked = Nz(Me.[Active],False)
 
You are a ROCK STAR! Worked like a charm! Thank you so very much! Have a
great day!
--
Randy Street
Rancho Cucamonga, CA


Ofer Cohen said:
On the AfterUpdate event of the check box run the code

If Nz(Me.[Active],False) = True Then
Me.[Date_On]=Now()
Me.[Date_On].Locked = True
Else
Me.[Date_On].Locked=False
End If

If you move between records, then use the OnCurrent event of the form to
lock the Date_On field

Me.[Date_On].Locked = Nz(Me.[Active],False)


--
Good Luck
BS"D


Randy said:
Hello...
Ok...I have a checkbox [Active] which when checked automatically enters the
current date/time into another control/field [Date_On]. What I am looking for
is a way to lock the field [Date_On] when the [Active] checkbox is checked
and/or the record is saved.

Any ideas would be greatly appreciated. I thank you in advacnce for your
time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top