How to filter selected records in a report?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eneyardi
    New Member
    • Jul 2010
    • 180

    #1

    How to filter selected records in a report?

    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.
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    This code will open the report in normal mode (use acPreview for preview) using the criteria you asked for.

    Code:
    dim strCriteria as string
    strCriteria = "[status]='Done'"
    docmd.openreport reportname, acNormal, strCriteria
    Jim
    Last edited by jimatqsi; Sep 3 '10, 07:44 PM. Reason: correction

    Comment

    Working...