Filtering Report via form selections

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with various filter criterea for one of my reports, including
several list box controls on the form. I have created text boxes that
summarize the selections together, and now I just need to learn how to
transfer that criterea to the filter property of the report. Is there someone
that can provide me with a bit of guidance regarding this issue?
 
You can filter the report when you open it using:
Docmd.OpenReport "ReportName", acViewDesign, , WhereCondition

It is in the WhereCondtion that you would specify what you would like
to filter.
"MyReportField = " & Me.MyFormField

If you are using a text value:
"MyReportField = '" & Me.MyFormField & "'"

If you are filtering on multiple fields:
"MyReportField = '" & Me.MyFormField & "' And MyOtherReportField = " &
Me.MyOtherFormField

I have used generic names in the commands. You will need to substitute
your field names into the statements.

Hope that helps!
 
Jeff
Slight variant on your answer. I have done this but the name of the report
field is "Date Received" which because of the space I have enclosed in square
brackets.

I have typed in what you have suggested but it keeps bringing up a dialogue
box asking me to 'Enter Parameter Value'. Any ideas?
 
Back
Top