The create date is easy enough just make it the default value for the field in table design. The change date needs to be done any place the record is changed typically in the after update event at the form level. I usually add a 3rd field to my tables to capture the user that made the change.
Assuming userID and changedDate are field names in your table. This catches a change to the record otherwise the creation date is set as a default value when the record is defined.
Default Value Now()
Private Sub Form_AfterUpdate()
Me.userID = CurrentUser()
Me.changedDate = Now()
End Sub
Assuming you spelled the field names correctly there are 2 methods CurrentUser() and Now(). Now() worked as the default value so it is unlikely the problem. Comment out the line on the current user and see if it runs. If so, then look under help to find an alternative to currentuser().
I now have a problem when the date is changed in the LastModified field.
Once you change something and then try and go on to another record the database seizes up and states that you are at the end of the recordset - yet the number of records in the database is 3000+
Are you in a Form tabbing through records? Are you in a vba code loop? There is not enough information to suggest a solution. Probably better to issue a new post defining the problem specifically.
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.