Using a Query to filter a Report

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I want to use a Query instead of an SQL statement to filter a report. I want this same query to be used several times throughout this project and do not want to have to find it in code every time it needs to be changed.

I have been able to use the SQL code successfully, but I think that it will be very difficult for someone else to manage later down the road.

I am looking of something like:

With Reports![rptRosters]
.Filter = "ID = Name of Query"
.FilterOn = True
End With

Your help is greatly appreciated!
 
Dan:

When you call the OpenReport method, you can specify a filter query to use
with that report. All that query has to do is have all the report's
required fields available and it will apply the criteria (i.e. conditions)
contained it in to the report. Look at that in the help file. Also, if
you want to apply a whole query in code, other than in the openreport
method, then set that query to the report's record source.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

I want to use a Query instead of an SQL statement to filter a report. I
want this same query to be used several times throughout this project and do
not want to have to find it in code every time it needs to be changed.

I have been able to use the SQL code successfully, but I think that it will
be very difficult for someone else to manage later down the road.

I am looking of something like:

With Reports![rptRosters]
.Filter = "ID = Name of Query"
.FilterOn = True
End With

Your help is greatly appreciated!
 
Back
Top