time stamp in a form

  • Thread starter Thread starter Tstates
  • Start date Start date
T

Tstates

I'm trying to create a time stamp when a check box is used.
Can anyone help me. Thanks
 
Create a checkbox (ArchiveFlag) and a date field (ArchiveDate). Then use
the AfterUpdate Event w/ following code:


Private Sub ArchiveFlag_AfterUpdate()

' Hides the ArchiveDate field until ArchiveFlag is checked
Me.ArchiveDate.Visible = Me.ArchiveFlag

' If the ArchiveFlag is checked, then the current date is entered/stored
If Me.ArchiveFlag = True Then
Me.ArchiveDate.Value = Date

' If the ArchiveFlag is unchecked, the date field is reset to "zero"
Else
Me.ArchiveDate = Null
End If

End Sub
 
Back
Top