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

Filtered Report?

Status
Not open for further replies.

NewfieSarah

Programmer
Feb 7, 2005
147
CA
Hey all, I have been trying to filter my report However It doesnt seem to be working the way I would like it to. I have the ability to filter on my form, so I can search Wood* and then there will be 27 records displayed so I can view each one speratly. however now I would like to have it on a report. I would like to then click the report button, and view those 27 records on my report as the layout that I have provied I can see multiple on a sheet. Any ideas?
 
Pass the query as a condition in the OpenReport method, e.g.:

Code:
Dim Condition as String
Condition = "[FieldName] = '" & Filter & "'"
DoCmd.OpenReport "ReportName",,,Condition

Replace "FieldName" with the field you want to filter and "Filter" with your filter, e.g. "Wood*". You can pass in the contents of a text box with something like "[Forms]![YourForm]![YourTextBox]" in place of "Filter" in the above code.

Have fun! :eek:)

Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top