The form's Current event is the right event. What you need to do is revise
how you make the "management" option work. Put a hidden textbox on the form
(name it txtManagement). Have the form's Load event procedure set the value
of this textbox to 0 (which is the value for False constant). Then code the
"management" hidden control to change the value of this textbox to -1 (which
is the value for the True constant). Then in the form's Current event, use
this code:
Me.AllowEdits = Me.txtManagement.Value

Signature
Ken Snell
<MS ACCESS MVP>
>I have a form in which I want to set 'allowedits = false' if the record is
> over 1 day old. I also have a hidden control that management can press to
[quoted text clipped - 13 lines]
> I have the code. I just need to know in which of the form's events to put
> it.
Ray - 10 Jul 2007 03:32 GMT
Does the Load event refer to whenever the form moves to a different record?
If so can I use something like
Iff (Now() - me.timestamp > 1.0, me.txtmanagement = -1, me.txtmanagement = 0)
in the form's Load event?
> The form's Current event is the right event. What you need to do is revise
> how you make the "management" option work. Put a hidden textbox on the form
[quoted text clipped - 23 lines]
> > I have the code. I just need to know in which of the form's events to put
> > it.
Ray - 10 Jul 2007 04:30 GMT
I got it. Thanks. Put the IIf in the oncurrent. That will not allow edits it
at the change of records and the control can allow edits until it moves to
another record.
> Does the Load event refer to whenever the form moves to a different record?
> If so can I use something like
[quoted text clipped - 30 lines]
> > > I have the code. I just need to know in which of the form's events to put
> > > it.