edit query in VBA

I have a query that I set up that I need to edit from VBA to specify criteria in two fields.  The results I then need to output directly to an excel spreadsheet.   I need to loop through a list of values to use for the search criteria and append the new results to the Excel sheet so that I have one sheet for all criteria values that were used in the query.  What is the best way to do this?
janderscuAsked:
Who is Participating?
 
peter57rConnect With a Mentor Commented:
Sounds like you should be building a table to hold the pairs of values for the selection.  You can then use a simple join from that table to the main table on these two fields, to select all the required records in one execution of the query.
0
 
Dale FyeCommented:
I agree with Peter.  Otherwise, you will have to automate Excel to start your output in a particular row of a particular spreadsheet.
0
 
janderscuAuthor Commented:
Sounds good.  Seems easy enough.
0
All Courses

From novice to tech pro — start learning today.