I have a field in table tblInstruments called ModDate. I want to record the date that a record is modified.
I have tried two things on my input form but neither are working.
First solution I tried is:
Private Sub Form_AfterUpdate()
Docmd.RunSQL UPDATE tblInstruments SET tblInstruments.ModDate = Date();
End Sub
That give me a syntex error.
I have tried:
Private Sub Form_Dirty(Cancel As Integer)
Me!ModDate.Value = Date
End Sub
That does nothing. I tried that code under AfterUPdate and the input form froze.
I am obviously a novice at VBA and have no clue to how to create code to perform my update. I have searched the web for examples and have not found anything. I'm stuck. :banghead:
Can someone please help?
Thank you.
Hefly
I have tried two things on my input form but neither are working.
First solution I tried is:
Private Sub Form_AfterUpdate()
Docmd.RunSQL UPDATE tblInstruments SET tblInstruments.ModDate = Date();
End Sub
That give me a syntex error.
I have tried:
Private Sub Form_Dirty(Cancel As Integer)
Me!ModDate.Value = Date
End Sub
That does nothing. I tried that code under AfterUPdate and the input form froze.
I am obviously a novice at VBA and have no clue to how to create code to perform my update. I have searched the web for examples and have not found anything. I'm stuck. :banghead:
Can someone please help?
Thank you.
Hefly