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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Filtering

Status
Not open for further replies.

Toga

Technical User
Jul 21, 2000
234
US
Checked the FAQ but couldn't find what I want to do.... I have a form tied to one of my query's as a recordsource.

Within the form, using the filter options by right clicking my mouse, I can filter the data down the way I want to see it in a report. (How I decide to filter it may change depending upon what I want)

Once I have it filtered....How do I send my filtered data to a report. If I tie my report to the same query name, It wants to print everything before I ended up sorting or filtering in my form.

Is there a way to do this so my report prints what I want???

Thanks

 
You can use your form's filter property value in the where clause of the DoCmd.OpenReport method.
Dim strWhere as String
strWhere = Me.Filter
DoCmd.OpenReport "rptA", acViewPreview, , strWhere

Duane
MS Access MVP
 
dhookom - Thank You! I can't believe I didn't try that myself before leaving the question except that I was having a major mental block! Anyways, works great!

Toga
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top