By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,828 Members | 801 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,828 IT Pros & Developers. It's quick & easy.

How to filter selected records in a report?

100+
P: 180
How to filter selected records in a report?
for example: i have a form name ADM List, the default view is split form so that i can view all the records. my report name is ADM Report. in ADM List i have a field names; subject and status. in a status field, i have a records of two pending and done (i have two option to put in a status field that is pending and done)
for example that i want to filter the status field to done so that all records contains done can only view. it easy to do these in my ADM List, but i want this filter to be effect in report when i click my command button print report.
Sep 3 '10 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 1,221
This code will open the report in normal mode (use acPreview for preview) using the criteria you asked for.

Expand|Select|Wrap|Line Numbers
  1. dim strCriteria as string
  2. strCriteria = "[status]='Done'"
  3. docmd.openreport reportname, acNormal, strCriteria
  4.  
Jim
Sep 3 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.