Filter reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NewtoAccess
    New Member
    • May 2007
    • 32

    Filter reports

    Is it possible to open and filter a REPORT based on a criteria as you would a form?

    If so would command be similar to:

    Private Sub OpenReport_Clic k()
    On Error GoTo Err_ViewDev_Cli ck

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "REPORT"

    stLinkCriteria = "[siteID]=" & Me![siteID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_ViewDev_Cl ick:
    Exit Sub

    Err_ViewDev_Cli ck:
    MsgBox Err.Description
    Resume Exit_ViewDev_Cl ick

    End Sub
  • JConsulting
    Recognized Expert Contributor
    • Apr 2007
    • 603

    #2
    Originally posted by NewtoAccess
    Is it possible to open and filter a REPORT based on a criteria as you would a form?

    If so would command be similar to:

    Private Sub OpenReport_Clic k()
    On Error GoTo Err_ViewDev_Cli ck

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "REPORT"

    stLinkCriteria = "[siteID]=" & Me![siteID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_ViewDev_Cl ick:
    Exit Sub

    Err_ViewDev_Cli ck:
    MsgBox Err.Description
    Resume Exit_ViewDev_Cl ick

    End Sub

    pretty much yes...except you would change openform to openreport.

    for access versions after 2002 I think you're allowed to pass criteria to a report
    J

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Originally posted by JConsulting
      pretty much yes...except you would change openform to openreport.

      for access versions after 2002 I think you're allowed to pass criteria to a report
      J
      You can do it in Access 2000

      Comment

      Working...