Write conflict

303factory

Registered User.
Local time
Today, 22:01
Joined
Oct 10, 2008
Messages
136
Hi

I have a form linked to a table. One of the text boxes on this form needs to trigger a function when updated, a function that updates the same table the form is linked to.

So the text box has the following code:

Private Sub ExhibitLocation_AfterUpdate()
Call AddExhibitNote("Location changed to " & Me.ExhibitLocation)
End Sub

The 'AddExhibitNote' function uses standard recordset/sql commands to add this string to a field on the table. The particular field is not linked to the form or displayed.

However as soon as you change the text box and click elswhere on the form you get the 'Write Conflict' error
'This record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes....' etc
You get the option to Save Record, Copy to Clipboard, Drop Changes.

There is nobody else using the access server file apart from me so I'm not sure why it's happening.. is it getting confused because I'm updating the table not via the linked form? Is there a way round this?

303
 
if you have edited a record (ie your form is dirty). and then you fire another process to update the same record, the process is bound to report that the record has been modified

either save the record before calling the function (application.runcommand acccmdsaverecord), or add the fields that need changing to the form you are using, and set them there in the fields after update event
 
if you have edited a record (ie your form is dirty). and then you fire another process to update the same record, the process is bound to report that the record has been modified

either save the record before calling the function (application.runcommand acccmdsaverecord), or add the fields that need changing to the form you are using, and set them there in the fields after update event

Ah I see, thanks!

303
 

Users who are viewing this thread

Back
Top Bottom