Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Open multple Access reports by same(one) criteria with DoCmd

Open multple Access reports by same(one) criteria with DoCmd

Open multple Access reports by same(one) criteria with DoCmd

Hi Buddies,
I want to open different Access reports by a combobox using DoCmd OpenReport for one(same) criteria at a time.
I use for single report (DoCmd.OpenReport "Combined_Report_1", acViewPreview, , "SR_Pcode=" & Me.txtSR_Pcode)
(I wrote above DoCmd 10 times for 10 different reports, It asks "Enter parameter value" 10 times for same SR_Pcode, it is dull for the user)
First I just select state region name(SR_Name which is alphabetically sorted) from the Combobox
While state region(SR_Name) selected from combobox, respective State Region code(SR_Pcode ) and State Region name (SR_Name_Mya) appear.
Then I click on “Open Report” Button(which is a Subform/Subreport under control group).
The message shows as “Procedure :cmdOpenReport 13 Type mismatch”
My codes are as follows:
Private Sub cmdOpenReport_Click()
Dim SR_List As Database
Dim SR_Name As String
Dim SR_Name_Mya As String
Dim SR_Pcode As String
Dim strCond As String
On Error GoTo Err_Process
If (Not IsNull(Me.cboSR_Name)) Then
DoCmd.OpenReport Me.cboSR_Name, IIf("[SR_Pcode]=" & "'" & Me![txtSR_Pcode] & "'", acViewPreview, acViewNormal)
strCond = Nz("Me.Me.cboSR_Name.Value", " ")
DoCmd.OpenReport "1_SR_Entry_Cost_Report", acViewPreview, , strCond
DoCmd.OpenReport "2_SR_Land_Access_Report", acViewPreview, , strCond
DoCmd.OpenReport "3_SR_Registry_Report", acViewPreview, , strCond
MsgBox "You must select a Township." & vbCrLf & vbCrLf & "Please try again.", vbExclamation, "No Township Selected"
End If
Exit Sub
MsgBox "Procedure: cmdOpenReport" & vbCrLf & vbCrLf & Err.Number & " " & Err.Description, vbExclamation, "Error"
Resume Exit_Process
End Sub
Thanks in advance

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close