Entering a date once only for four different queries?

chuckles1066

Banned
Joined
Dec 20, 2004
Messages
372
I have a macro that runs four different queries.

Each query needs a date entered (it's the same for each query).

I originally had an [Enter date:] criteria in each query but assumed that using a function and grabbing the initial user input would be enough to fire all four queries without having to enter the date each time.

Wrong!

So my question is: how do I grab that initial user input and store it for use in subsequent queries?

TIA.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
One trick that I often use is to create a one-record Table that holds criteria to be used for many different queries. I then usually have a criteria Form based on this table where users can easily enter the desired criteria.

I then link that table into all of my queries that depend on that value. So they only need to update it one place.
You can even create a command button on that same criteria form to call and run your queries. So it can all happen from one place.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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