View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Automating MS Query

You can make your query a parameter query (in the MSQuery dialog, in the
menu go to Criteria - Add. ) In the values box for the date field, put in a
?

Now return the data to Excel. You should get a prompt for a date. Give it
a date.

When you are back in Excel, right click on the data and select parameter
from the Popup menu. Click the option button for Cell and then click in the
textbox, then put in = and click in the cell where you want to enter the
date.

Repeat for all you query tables. They can all refer to the same cell if
that is appropriate.

--
Regards,
Tom Ogilvy

"Jen" wrote in message
...
Hello,

I have an Excel spreadsheet that uses MS Query to pull
data from a SQL database. Each month the user has to go
in to each separate query (there are 12) to enter the
appropriate date range. I'm looking for ideas on how to
automate this. Either have a pop-up box where they enter
the date one time, or somehow have the queries refresh
with the most current month end. I need some ideas on
where to even begin. I know a little VBA, but only from
recording my macros and then editing the code. I've never
coded from scratch.

Any ideas would be great!

Thanks!
Jen