Filtering Report via form selections

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?
 
J

Jeff L

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!
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top