Want to get rid of Update Query Messages

coffeeman

Registered User.
Local time
Today, 03:51
Joined
Oct 13, 2008
Messages
58
I am running an update query on an "On Load" macro for a form. Is there a way to get rid of the 2 message pop ups stating that you are about to run a query, click yes and how many rows will be updated, click yes?

Is there a way to bypass this and automatically run the query and make yes be the answer to the popup messages without having it pop up?

Thanks!
 
I am running an update query on an "On Load" macro for a form. Is there a way to get rid of the 2 message pop ups stating that you are about to run a query, click yes and how many rows will be updated, click yes?

Is there a way to bypass this and automatically run the query and make yes be the answer to the popup messages without having it pop up?

Thanks!

If you are using Macros, try using the SetWarnings Command.
If you are using VB Code, try using the DoCmd.SetWarnings Command
 
Use CurrentDB.Execute for your action query instead of DoCmd.
 
CurrentDB.Execute does *not* issue warnings but warnings are still enabled in case something else happens.
 
CurrentDB.Execute does *not* issue warnings but warnings are still enabled in case something else happens.

Thanks, that is very good to know. It also looks like VB Code Format. Is there an equivilent in MACRO Code, becasue it sounded like the OP was using Macros.
 
Thanks, that is very good to know. It also looks like VB Code Format. Is there an equivilent in MACRO Code, becasue it sounded like the OP was using Macros.

Don't think so. But SetWarnings No in macro does not leave the warnings turned off.
 
Don't think so. But SetWarnings No in macro does not leave the warnings turned off.

Actually, In my experience, it seems to do just that, so I always reverse the process as the last line in a Macro.
 
Actually, In my experience, it seems to do just that, so I always reverse the process as the last line in a Macro.


Not for me and that has been in A95 and A2003

Just tried it then. Made an append query and in a macro SetWarnings No followed by OpenQuery and ran macro and of course no warning

Then went to table and Copy, opened other table and Paste and up popped the box with the bell ring:)
 
I believe some versions turn the warnings back on if you have turned them off in a macro. I still think it is just good programming practice to turn them back on if you have turned them off; whether you are in code or a macro.
 
I believe some versions turn the warnings back on if you have turned them off in a macro. I still think it is just good programming practice to turn them back on if you have turned them off; whether you are in code or a macro.

Yes, I think that is a good idea since it does not appear to be a definite with macro.

It is interesting that code (and sometime macros:)) leave the warnings turned off because as you know when the properties of a form are changed by code or macro it is only temporary, unless it has been done where the form is opened in Design and then saved/Closed.

Has anyone tried running code with the warnings turned off but no turn back on and then closed and reopened the DB to see if they are still turned off.

.
 
I just tried that. When I closed and reopened the DB they were still off but when I closed Access and reopened they were back on.
 

Users who are viewing this thread

Back
Top Bottom