Record has been changed by another user ????

cpampas

Registered User.
Local time
Today, 12:21
Joined
Jul 23, 2012
Messages
221
Code:
Dim db As Database
Set db = CurrentDb()

    strSQL = "UPDATE tblEmpresas " _
            & " SET ActividadeID = " & zz & ", categoriaID =" & z2 _
            & " WHERE metadados = '" & meta & "'"
            
 db.Execute strSQL       
Me.Form.Requery


After I run the query a messagebox "This record was edited by another user ......." ( my Access is not in eglish, this is not a literal translation)

with 3 options :

save record
copy to clipboard
Dismiss changes

At what moment this record has been changed ? there is no other attempt to edit these records. Is there a way to bypass this message?
 
Hi. If you're updating the same table as your form using code, then you could get this error.
 
There are many reasons for write conflict errors.

Is the table you are trying to update in SQL Server?
If so, does it contain any bit fields?
 
Does it help if you make sure the form record is SAVED, before running the .Execute line?
For example:
Me.Dirty=False
...execute your sql
Me.Requery
 
Now I got it . my form, and my code are competing to edit/save records.
No sql server or bit fields
but, Isaac's idea works like a charm

Thanks for the great help
 
Now I got it . my form, and my code are competing to edit/save records.
No sql server or bit fields
but, Isaac's idea works like a charm

Thanks for the great help
Glad to hear it's working!
 

Users who are viewing this thread

Back
Top Bottom