Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Existing Report Access 2000

Status
Not open for further replies.

willz99ta

IS-IT--Management
Sep 15, 2004
132
US
Howdy,

I am trying to change the query or filter certain results on an existing Microsoft Access 2000 report.

Thanks for any help!
Will
 
If the report is built directly against a table, you can build a query against that table with the filtering you need then set the RecordSource property to your new query.

Another approach is to set a filter in the report (that is a WHERE clause without the word WHERE).
 
You can use code in the DoCmd.OpenReport method to apply a where condition. Code in the On Open event of the report can change the Record Source of the report. Another option is to set criteria in the record source query.

Duane
Hook'D on Access
MS Access MVP
 
is there a way to do it with the Filter option in the report properties?
 
I have never used the DoCmd.OpenReport -- How do I use it in a report with no VBA?
 
For anyone readin' along this is how I filtered my report:

1. In the design view of the report, I right clicked the blank dark area around the report design grid and selected properties.
2. I erased what was in the "Record Source" field and wrote the query for the report in SQL

It looked like: SELECT Equipment.* FROM Equipment WHERE (((Equipment.[Subgroup Priority]) Is Null)) OR ((Equipment.[Subgroup Priority])="0");

In the words of Emiril -- BAM!

Will
 
or if you click the [..] button to the right of the 'Record Source' section you will get a query design screen where you can then create a query the report should run against.

You can even link queries together or table joins.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
willz99ta said:
I have never used the DoCmd.OpenReport -- How do I use it in a report with no VBA?
All you have to do is use the command button wizard which will write most of the code for you. You can then modify the code to add a where condition in the DoCmd.OpenReport line.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top