time stamp in a form

T

Tstates

I'm trying to create a time stamp when a check box is used.
Can anyone help me. Thanks
 
T

Tom

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
 

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

Top