Set filter for report from form

G

Guest

I have an option group on a form to (1) Select a category
or (2) all categories for a report. I've set the filter
variable (strFilter) and use

DoCmd.OpenReport stDocName, acPreview, strFilter

to open the report. How do I set the report to accept this
filter?
 
A

Allen Browne

Use the WhereCondition instead of the filter. Example:

strFilter = "ID = " & Me.txtID
DoCmd.OpenReport stDocName, acPreview, , strFilter
 

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