Passing a Query arguments into an access report

  • Thread starter Thread starter JD
  • Start date Start date
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?
 
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.
 
Back
Top