Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pass criteria in Microsoft Query

I have a macro I wrote that executes 4 queries to an ODBC Database.
Each query runs on different table in the database but uses the same
search criteria. How can I pass the saved variables to the 4 queries
so the user doesn't have to enter them 4 times.

Thanks for the help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Pass criteria in Microsoft Query

for each myvariable in mylist
=" & myvariable
next

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
I have a macro I wrote that executes 4 queries to an ODBC Database.
Each query runs on different table in the database but uses the same
search criteria. How can I pass the saved variables to the 4 queries
so the user doesn't have to enter them 4 times.

Thanks for the help


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Pass criteria in Microsoft Query

Use parameters in the queries, then have the parameters refer to the
cell(s) where the criteria have been entered.

Thanks!
Cliff Edwards

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pass criteria in Microsoft Query

On Feb 6, 10:40*am, ward376 wrote:
Use parameters in the queries, then have the parameters refer to the
cell(s) where the criteria have been entered.

Thanks!
Cliff Edwards


So in the query on the criteria line I put a cell reference? I can
enter the values into a cell on the spreadsheet how do I have the
queries refer back to that cell when the macro is running?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Pass criteria in Microsoft Query

Where are you querying from? (Access, as400 etc.) Are you using MS
Query?

If you can edit the SQL statement directly substitute a question mark
for an explicit value.

Cliff Edwards

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you pass the prove it test for Microsoft Excel? jerry New Users to Excel 4 April 7th 23 12:17 PM
I want to help you pass your Microsoft certification exams. pass4surenl1 Excel Worksheet Functions 0 March 4th 09 07:02 AM
Guide you to Pass Microsoft Certificaton Exams in the first try pass4surenl Excel Discussion (Misc queries) 0 February 25th 09 02:55 AM
$30 Pass4Sure to pass microsoft certification exams. ExamClear.Com Excel Worksheet Functions 0 February 13th 09 04:03 PM
Microsoft query criteria help tina Excel Discussion (Misc queries) 0 April 20th 05 02:59 PM


All times are GMT +1. The time now is 02:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"