Command button problem

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

Guest

I have a command button that runs an update query and concatnates attributes
entered into a form, creating a unique field id. I want the command button to
run right after I enter in the require fields into the form, but it does not
work unless I move off the record form, then return to it. The update query
is set up to use fields in the table where the form is putting data. Is
there any way I can get this work right after I enter the data in the form?
 
Kevin,

If I understand the process you are using here, it sounds like the newly
entered data needs to be saved before it can be used as the basis of the
Update Query. Just put a line like this...
DoCmd.RunCommand acCmdSaveRecord
.... into the code prior to the bit that runs your update.
 
Thanks a lot. Any idea on how to de-activate the message boxes that warn me I
am about to update a table. I am considering this to make it work smoother.
 
Kevin,

Two options:
1. Put DoCmd.SetWarnings False in your code before the update, and
DoCmd.SetWarnings True afterwards.
2. Use the CurrentDb.Execute method to run the update.
 
Back
Top