Google Answers Logo
View Question
 
Q: Access Report - query parameter ( No Answer,   0 Comments )
Question  
Subject: Access Report - query parameter
Category: Computers > Programming
Asked by: bselltiz-ga
List Price: $35.00
Posted: 03 Nov 2003 09:28 PST
Expires: 03 Dec 2003 09:28 PST
Question ID: 272184
I have a report that I open from code. The report is bound to a stored 
query. It is an aggregate query with 5 fields that show up on the 
report, 3 are grouped and 2 are summed. The query also has 2 fields 
that don't show in the result that are used to specify criteria. This 
criteria is known at design time and is coded into the query. I need 
to learn how to supply a 3rd criteria who's value will not be known 
until I call the open report command from code. I don't want this 3rd 
criteria to be part of the query's result set, which would alter my 
grouping results. How do I supply this parameter to the query using 
code, when opeing the report? 
Thanks, 
Brian

Request for Question Clarification by mathtalk-ga on 03 Nov 2003 16:19 PST
Hi, Brian:

The short answer is that there's a parameters collection associated
with a query object in Access, and you have to explicitly set the
values there before the query can be executed properly.  Typically if
you don't set all the parameters in code, then when you "open" the
query, a popup will interactively prompt you for the missing values.

For the sake of a precise answer, please clarify what version of
Access you will be working with.  Also, am I correct in assuming that
the code you mean is VBA code written within Access?  It's possible,
of course, to automate Access and its query objects from another
Office product, or even from ASP or C++, but I'm thinking you would
have mentioned it if you intended something so complicated...

regards, mathtalk-ga

Clarification of Question by bselltiz-ga on 04 Nov 2003 06:03 PST
Hey mathtalk,

I am working in Access 2002 and am writing my code in VBA.
I usually use ADO (2.5) in my code but if I had to I could use DAO.

I am familiar with the pop up parameter scenario and want to avoid
that. Unfortunately one area in coding that I am not 100% on is
objects. If you could explain how to set this up from start to finish
that would be really great.

Thanks :->

Brian
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy