General discussion

Locked

write conflict "record changed by .."

By ra_tevis ·
I have a form with subform. The subform has a check box that when checked kick off processes that I have programmed in the after update event. The main process is to open a recordset (the same query that runs the subform) this recordset will make some changes to the current record and sometimes add an additional record. The problem is when you are returned to the form you receive an error "record has been changed by another user". To avoid this I had to close the form and reopen it after the recordset has been edited. This is not great because the form is reset to all records and a password text box is reset. Why is it that I can't change the records with my recordset and see the updated record in my form. Yes I have tried to requery, and repaint my form. This is causing me headaches. Really need some help here.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

write conflict "record changed by .."

by donq In reply to write conflict "record ch ...

Are both your main and sub forms based on a query? I too think requery is your answer to synchronize these two queries BEFORE focus is returned to a main form object outside its subform. Your main form is not recognizing the added records because I don't think editing data ONLY would cause the error? Make sure you open and requery the main forms query from within your code called from the subform checkbox BEFORE the procedure ends and AFTER any new records are added.

Collapse -

write conflict "record changed by .."

by ra_tevis In reply to write conflict "record ch ...

The main form is unbound. It only contains combo boxes and option buttonsthat are used as criteria for the query for the subform, and to filter the records displayed. I can't understand why I can't use a recordset behind my form the change data and then refresh the form. If anyone has done this and can send me sample code, i will look to see if I have missed something. I could email my form with sample data if someone can take a look at it. I appreciate any help that can be provide.
Thanks

Collapse -

write conflict "record changed by .."

by roc180 In reply to write conflict "record ch ...

I sent you an email explaining the problem and asking you to send me your code so I can edit it. In a nutshell heres the problem, when you edit the subform Access locks that record, you then fire off an after update event that further manipulates the record without first allowing Access to release its record lock. This will cause Access to prompt you with two users are trying to edit the same record. As soon as you send me your code I'll make the changes and send it back.

Good Luck

Neal Martinelli

Collapse -

write conflict "record changed by .."

by ra_tevis In reply to write conflict "record ch ...

Sent the sample. Have not heard anything yet. Will close this question if no reply is recieved in a few days. Thanks to all who have tried to help

Collapse -

write conflict "record changed by .."

by Gicu Artistu' In reply to write conflict "record ch ...

Even if your form is unbound if you use the record directly that's gonna happen always. Put them in memory variables and create accessor functions.

Collapse -

write conflict "record changed by .."

by ra_tevis In reply to write conflict "record ch ...

I have considered this solution. Just was hoping it was not the answer. Thanks to all.

Collapse -

write conflict "record changed by .."

by ra_tevis In reply to write conflict "record ch ...

This question was closed by the author

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums