how do i record changes to data

M

Matrix

I am wanting to record the date of any changes made to my data on a products
form. I have inserted the following code to confirm save changes and all
works perfectly.

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "@Do you wish to save the changes?"
strMsg = strMsg & "@Click Yes to Save or No to Discard changes."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
Me.Undo
Cancel = True
End If
End Sub


The problem i have is i am wanting a Me.DateChange to field to automatically
insert the date the data was changed so i can keep track on any data changes.

Can anybody please help.
 
M

Matrix

Yipee i have sorted my problem. I added the following where the code says

'do nothing (i entered) Me.Date_Change = Now()
 
J

Jamie Richards

Satisfying, isn't it? ;o) Great job.

Jamie


Matrix said:
Yipee i have sorted my problem. I added the following where the code says

'do nothing (i entered) Me.Date_Change = Now()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top