You can add a button to your form that, when clicked will add the current date for your user to a field.
Create a button and call it cmdAddDate. Insert the code below into the On Click event procedure of the button. The field txtCompleted refers to the field you want to insert the date into.
Private Sub cmdAddDate_Click()
On Error GoTo ErrorAddDate
Me.txtCompleted = Date
ExitAddDate:
Exit Sub
ErrorAddDate:
MsgBox Error.Description
Resume ExitAddDate
End Sub
For date and time, use the following code. Make sure you change the field's Format properties to General Date.
Private Sub cmdAddDate_Click()
On Error GoTo ErrorAddDate
Me.txtCompleted = Now()
ExitAddDate:
Exit Sub
ErrorAddDate:
MsgBox Error.Description
Resume ExitAddDate
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.