Hi. I have created a form so a user can enter a serial number, device type, and so on for tracking inventory. I am able to get the date field to autofill with the current date. Just in case someone accidently types in something else, however, I want it to re-fill the field with the correct date. This is the VBA code I used for the form:
- Option Compare Database
-
-
Private Sub WhenLastModified_Enter()
-
-
Me!WhenLastModified = Date
-
-
End Sub
-
-
Private Sub WhenLastModified_Exit()
-
-
If Not (Me!WhenLastModified = Date) Then
-
Me!WhenLastModified = Date
-
End If
-
-
End Sub
It makes sense to me, but of course computers don't speak plain English and I get this error message when I enter the field:
"Procedure declaration does not match description of event or procedure having the same name."
Any help on this would be much appreciated.
Thanks,
Josh