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

Filter reports

P: 32
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_Click()
On Error GoTo Err_ViewDev_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "REPORT"

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

Exit_ViewDev_Click:
Exit Sub

Err_ViewDev_Click:
MsgBox Err.Description
Resume Exit_ViewDev_Click

End Sub
Jun 4 '07 #1
Share this Question
Share on Google+
2 Replies


JConsulting
Expert 100+
P: 603
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_Click()
On Error GoTo Err_ViewDev_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "REPORT"

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

Exit_ViewDev_Click:
Exit Sub

Err_ViewDev_Click:
MsgBox Err.Description
Resume Exit_ViewDev_Click

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
Jun 4 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
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
Jun 6 '07 #3

Post your reply

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