Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Reports Popping Up.

Status
Not open for further replies.

CCPKGUY

IS-IT--Management
Feb 25, 2013
30
US
I have a question. Look at the script below. Where it says stDocName and strQueryName how to add multiple entries? When I click on that button to generate the report I would like for multiple reports to pop up.


Private Sub Generate_CCPK_Employee_Discount_Report_DblClick(Cancel As Integer)

On Error GoTo Err_Generate_CCPK_Employee_Discount_Report_DblClick

Dim stDocName As String
stDocName = "CCPK Discount Employees Fulltime1"
Dim stWhere As String
strQueryName = "CCPK Discount Employees"
If Not IsDate(Me.txtBeginning) And IsDate(Me.txtEnding) Then
stWhere = "[trans_date] <=" & SQLdate(Me.txtEnding)
ElseIf IsDate(Me.txtBeginning) And Not IsDate(Me.txtEnding) Then
stWhere = "[trans_date] >= " & SQLdate(Me.txtBeginning)
ElseIf IsDate(Me.txtBeginning) And IsDate(Me.txtEnding) Then
stWhere = "[trans_date] Between #" & Me.txtBeginning & "# And #" & Me.txtEnding & "#"

End If
'MsgBox stWhere
Debug.Print "Beginning: " & Me.txtBeginning & "Ending: " & Me.txtEnding & " StWhere: " & stWhere
DoCmd.OpenReport stDocName, acViewPreview, , stWhere
Exit_Generate_CCPK_Employee_Discount_Report_DblClick:

Exit Sub
Err_Generate_CCPK_Employee_Discount_Report_DblClick:
MsgBox Err.Description

End Sub
 
I'd use arrays and For Each.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top