I would like to have date and time field on form populate with the current date and current time in separate fields when an entry is created. The date is Short Date and the time is Long Time format. This is for auditing purposes and has a separate Last Modified field. The following code does not work, any suggestions?
Code:
Private Sub Form_BeforeInsert(Cancel As Integer)
Me![txtDateCreated] = Date
Me![txtTimeCreated] = Time
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![txtLastModified] = Now()
End Sub