Running a Macro that runs a query

mcgilla

Registered User.
Local time
Today, 14:17
Joined
Sep 17, 2010
Messages
31
I have a couple of update querys that search a status and/or date information and change the status of the record based on the criteria I've given. The querys work fine, I've just tried to use a Macro to run both queries.

In testing the Macro it worked, but it prompted me four times.. two prompts for each query; a warning that I'm about to run an update query that will modify my data and then a "You are about to update x records" prompt.

Is there any way to avoid this prompt. I know this falls under querys, macros and even VBA if there's a way to do this there. But I have to start somewhere. I don't want to uncheck the "Action Queries" prompt as I want to keep my users wary of some things they may receive.

If I can make this ignore the prompts for my own creations, I'll probably have it run on open of the database so that it is always updated.

Thanks in advance for the help.

Ed

Users will have Windows Xp or Vista and Access 2007.
 
do setwarnings = No before running the queries and setwarnings = yes afterwards
 
you need to invoke the Set Warnings False prior to the action query and back to True after completion
 
Thanks to both..

Though I've used access since 97, I've steered away from Macros.. not sure why.. but I'd consider myself uneducated in them.

that was much easier than I thought.
 
Same here, not to the 97 part, but ive steered away from them. I am starting to see the light when using them for certain things though... ie make table queries on startup etc...
 
In VBA it would look like

Code:
DoCmd.SetWarnings False
DoCmd.OpenQuery "Q1"
DoEvents
DoCmd.OpenQuery "Q2"
DoEvents
DoCmd SetWarnings True
 

Users who are viewing this thread

Back
Top Bottom