I have a button used to append form changes to a table, which works as expected.
However, after clicking the form remains in edit mode (the pencil icon) and I cannot exit the form or go to a new record without getting a Write Conflict error.
I have a button used to append form changes to a table, which works as expected.
However, after clicking the form remains in edit mode (the pencil icon) and I cannot exit the form or go to a new record without getting a Write Conflict error.
As a rule a form should either be bound to a table or code used to change the data, not both.
If it's bound to the table, why are you making data changes in code? You can try
If Me.Dirty Then Me.Dirty = False
but you will get the same error if you're changing data in the background that's displayed on the form.
Ok so the context:
I have a design for a multi-user database:
1. Form A is used to update Table A and Table B (simultaneously On Click)
2. Form B is used to review Table B, approve records, then delete them from Table B
Changes made in Form A are reflected in Form B. Approving these changes sends the data to the appropriate tables. However, the form remains in edit mode and I get the Write Conflict error.
If this is a design error, would you recommend a different approach?
Access is protecting you from yourself. It senses that data you have open on the form has been changed behind the scenes. The error you get is how it warns you that it happened. The solution is to either let the bound form change the data and get rid of the code, or let the code change the data and make the form unbound (removing the form's record source and the textbox control sources).