Passing a Query arguments into an access report

J

JD

Hi Everyone,

Is it possible to pass query arguements into an access
report.


If you have a query like so

SELECT * FROM tblContact WHERE Reponsibile IN
("Owner","Employee") OR Market IN ("Beaches","Computers")

Where I would like to be able to pass in the values for
the where clause....is this possible to do?
 
M

Marshall Barton

JD said:
Is it possible to pass query arguements into an access
report.

If you have a query like so

SELECT * FROM tblContact WHERE Reponsibile IN
("Owner","Employee") OR Market IN ("Beaches","Computers")

Where I would like to be able to pass in the values for
the where clause....is this possible to do?


Not really, but maybe you can get by with filtering the
report's data in the form where the report is opened.

You can specify the Where clause using the OpenReport
method's WhereCondition argument:

DoCmd.OpenReport "reportname", acViewPreview, _
WhereCondition:= "Reponsibile IN ('Owner','Employee') " _
& " OR Market IN ('Beaches','Computers')"

I can't double check it now, but I believe that the
WhereCondition string is then placed into the report's
Filter property so it is possible for the report to retrieve
it, but I don't see much need to do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top