Write conflict with Update query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,
I've got a form where, if a record has already been exported (there's a
yes/no flag for this), the flag is set to NO where the user changes the value
in the txtCands field - this is so that the record will be exported again
with the new values. The update query (written in sql) is actioned on the
'after update' event of txtCands.
When the write conflict box appears you can select Save Record which then
does not carry out the update query but it does save the change to txtCands.
If I select Abandon Changes then it will update the Exported flag to read No
but it doesn't save the changes to txtCands. This is not currently a
multi-user database as it's only me writing it/testing it.
I presume it doesn't like being asked to change the record twice (ie update
the flag and amend the number in txtCands). Any idea how I might get round
this?
It doesn't work on the Before Update event either.
Many thanks in advance for any help you can give.
Regards,
Lee
 
Baby Face Lee said:
Hi everyone,
I've got a form where, if a record has already been exported (there's a
yes/no flag for this), the flag is set to NO where the user changes the value
in the txtCands field - this is so that the record will be exported again
with the new values. The update query (written in sql) is actioned on the
'after update' event of txtCands.
When the write conflict box appears you can select Save Record which then
does not carry out the update query but it does save the change to txtCands.
If I select Abandon Changes then it will update the Exported flag to read No
but it doesn't save the changes to txtCands. This is not currently a
multi-user database as it's only me writing it/testing it.
I presume it doesn't like being asked to change the record twice (ie update
the flag and amend the number in txtCands). Any idea how I might get round
this?
It doesn't work on the Before Update event either.
Many thanks in advance for any help you can give.
Regards,
Lee

If the yes/no field (let's suppose it's called "Exported") is in the table
to which the form is bound, you don't need to run an update query, just set
it's value in the form's recordsource, thus:

[Exported] = False
 
Doh!!! Do I feel stupid or do I feel stupid!?
In my defence, I've only just added the Exported field to the table so I'd
overlooked the fact that it's part of the recordsource! The bleedin' obvious
has passed me by yet again...:-)

Thanks Brian!

Regards,

Lee
 
Back
Top