Update other field using BeforeUpdate Event

M

Michael

Hi All. I have used the Form BeforeUpdate Event to change
the data in a DateLastModified field using the following
code

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.DateLastModified = Date
End Sub

It works fine, but when I go to edit the same record
again, I get the following error without an error number.

"The data has changed
Another user edited this record and saved the changes
before you attempted to save your changes.
Re-edit the record."

I am then able to re-edit the record.

I have also tried using alternate methods to update the
field such as recordsets, RecordsetClone, even triggers
from the back end SQL server, but they all give the same
result.

One other detail is that the message happens after the
keydown event for the control.

Please help!! - Thanks
 

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