Solved

edit query in VBA

Posted on 2011-03-24
3
610 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:janderscu
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 35208183
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
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 35210605
I agree with Peter.  Otherwise, you will have to automate Excel to start your output in a particular row of a particular spreadsheet.
0
 

Author Closing Comment

by:janderscu
ID: 35214689
Sounds good.  Seems easy enough.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Allow user to edit an outgoing email 2 25
Archiving Access table older than 6 months 9 39
Calculation in Access 5 26
Dcount help 2 17
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question