Update Query for Current Record

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

Guest

I want to run an update query for the current record in a form by clicking a
command button. When I do this, I get a prompt letting me know that the
current record is being changed by another user. Is it possible to override
this prompt using code?
 
You could start by making sure any changes are saved in the form before you
also try to change it in the Update query, i.e.:
If Me.Dirty Then Me.Dirty = False
dbEngine(0)(0).Execute "MyUpdateQuery", dbFailOnError

That could still fail under some circumstances. If you are just changing the
record in the form, why not assign values to its controls/fields instead of
running an update query?
 
That's sounds like a much better idea. What would be the best way to go about
doing that? (just a nudge in the right direction would be much appreciated)

Thanks,
Murp
 
If you have a form named "Form1", with a text box named "City", the code
would be:
Forms![Form1]![City] = "Springfield"
 
Back
Top