Pop up msgs when running Udate query/macro

mkdrep

Registered User.
Local time
Yesterday, 23:55
Joined
Feb 6, 2014
Messages
181
I have 3 different "buttons" on my form that run individual update queries. I know these update queries are running correctly. Decided to make a macro that will allow me to run all these queries by clicking one macro button.

My question is: Is there some way to stop the pop up msg that advises I am about to run an update query and the next pop up msg that informs me of how many rows I am going to update?

These pop up boxes are starting to drive me crazy when I run the macro.

Thanks for the help....Mark
 
use currentdb.execute rather than docmd.runsql - not sure if you can do this in a macro tho'

Alternatively, you can use docmd.setwarnings to turn the messages off and then on again
 
I used your second suggestion about turning the warnings on and off and it worked perfectly! Thank you!! :)
 
The downside of turning SetWarnings off is that any failure will be ignored.

Also be certain that they are turned back on again after the procedure, even if the procedure fails. Otherwise all warnings for the application will remain off for the rest of the session.

Execute (with dbFailOnError enabled) is a far better solution but it does not support references to Access objects such as controls on forms.
 
Execute (with dbFailOnError enabled) is a far better solution but it does not support references to Access objects such as controls on forms.
not directly but you can still build them into the sql string - unless I'm misunderstanding your point
 
No you cannot build a reference to an Access object into a string. It still won't work.

The values from Access objects can be built into a dynamic sql string using concatenation but that is a different matter entirely. At that point it becomes a value rather than a reference to the object.

Execute cannot run any query that contains a reference to an Access object so saved queries that include such reference don't work either.
 

Users who are viewing this thread

Back
Top Bottom