Macro to Run Update Several Update Queries w/o displaying (1 Viewer)

3link

Registered User.
Local time
Today, 09:58
Joined
Jun 1, 2012
Messages
12
I want to attach a macro to a button that runs several update queries without opening (or displaying) any of those queries and without any warnings (like the warning you get that you are about to update several records). I just want it to execute. I'm making this for someone who knows even less about access than I do and I don't want him to get confused by those prompts. I also don't want him seeing the update queries because I'm afraid he'll mess with them and screw them up.
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 12:58
Joined
Oct 17, 2012
Messages
3,276
Add a line before you run the queries. For the action, select 'SetWarnings', and set the argument to 'No'. Then, add a line after the final action query. The action will be 'SetWarnings' again, but this time set the argument to 'Yes'.

Be aware that if the macro terminates before completion, warnings will be disabled until someone either sets them to Yes or the database is closed and re-opened.
 

3link

Registered User.
Local time
Today, 09:58
Joined
Jun 1, 2012
Messages
12
Add a line before you run the queries. For the action, select 'SetWarnings', and set the argument to 'No'. Then, add a line after the final action query. The action will be 'SetWarnings' again, but this time set the argument to 'Yes'.

Be aware that if the macro terminates before completion, warnings will be disabled until someone either sets them to Yes or the database is closed and re-opened.

Thank you.

So I have to use VBA for this? I've just been using the macro builder. I guess I could just convert the macro and then add those lines.
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 12:58
Joined
Oct 17, 2012
Messages
3,276
Nope, the directions I gave were for use in the macro builder. VBA handles the syntax a bit differently.
 

Users who are viewing this thread

Top Bottom