Solved Write Conflict on record when closing

Lochwood

Registered User.
Local time
Yesterday, 17:38
Joined
Jun 7, 2017
Messages
130
I have a date field on a form and VBA after update event if the date field is null it ticks a box, if it is not null it unticks the box.. code works but when i close form it gives me a write conflict.. someone else has changed the record. I have also tried adding me.dirty=false at the start and end of code.

Any thoughts?
 
Why create a tick box to "calculate" something that can very easily be done either on the fly or can just simply be selected on the table

??

Solution: Not do it this way.
 
The tickbox is a field on the table. before this was a manual tick but i am trying to get the code to tick it for me based on the condition of the date field. i was going to discard the tick box completely and have a calculated field on the query showing result but thought i would accommodate the tick box
 
do not use SQL to Update the table. Use your Form's Recordset.
The reason is that if you edit the record in Form (the record is but a Snapshot) and
you use SQL to update the underlying table again, the physical table (the recordsource of
the form) is now Become more "Updated" than what you are trying to update in the form.
therefore, access complains.
 

Users who are viewing this thread

Back
Top Bottom