Use the AfterUpdate event procedure of the check box to drop the date into
your other field:
Private Sub ceased_AfterUpdate()
If Me.ceased.Value Then
Me.CeasedDate = Date
Else
Me.CeasedDate = Null
End If
End Sub
In the Current event of the form:
Private Sub Form_Current()
Dim bDisabled As Boolean
With Me.ceased
bDisabled = Nz(.Value, False)
If .Enabled = bDisabled Then
.Enabled = Not bDisabled
End If
End With
End Sub
You need to add error handling to Form_Current, to handle the case where the
ceased check box cannot be disabled because it has focus.
The code above will make the ceased check box disabled next time you load
the record in the form once it has been checked.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<z.******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I have a check box on one of my forms, let call the field "ceased?",
and when it is checked I would like the current date put into my date
field and the "ceased?" field protected.
Would anyone know the code to do this?
Any help would be greatly appreciated