How to make a macro

lwilt

Board Regular
Joined
May 16, 2013
Messages
187
I'm trying to figure out how to make a macro in access so that I don't have to individually run 20 queries every time I need this data. How would I set this up. Each query is named pricing Q1...Q20. I assumed the first action needs to be open query pricing Q1 and have a data mode of edit but I wasn't sure.

And then I keep opening the rest of the queries as the next steps but that didn't seem to work....please help
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
hmm it seems the first data mode needs to be add.... but is that the cause for the whole thing to run all the queries?
 
Upvote 0
What is the nature of all 20 of these queries?
Are they all Action queries (Append, Update, Delete)?
If not, if they are just a bunch of nested Select queries, you shouldn't need to open each one. Just open the last one, they rest will be run automatically.

If these are indeed all action queries, why do you have so many? You may have a design issue which should be corrected, especially if a lot of these queries are basically doing similar tasks.

Also note that you can create a macro with 20 OpenQuery actions. So you would only need to set it up once, then just run this single macro each time to run all 20 Action Queries.
 
Upvote 0

Forum statistics

Threads
1,221,860
Messages
6,162,479
Members
451,769
Latest member
adyapratama

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top