J
JOM
How will add a message box to the following code so that it tells the user
that they are about to x number of records of whatever criteria they choose.
If there are no records that match there criteria, then just go back to the
form no need to preview the report.
Private Sub Preview_Click()
Dim strDocName As String
Dim intPage As Integer
strDocName = "rptInvoice"
If Me.CustType.Column(0) = "<All Customers >" Then
DoCmd.OpenReport strDocName, acViewPreview
ElseIf Me.CustType.Column(0) = "<Mid W Cust>" Then
DoCmd.OpenReport strDocName, acViewPreview, , "[PrintBTime] is
null And [LoanType] ='" & "MWC" & "'"
ElseIf Me.CustType.Column(0) = "<Central Cust>" Then
DoCmd.OpenReport strDocName, acViewPreview, , "[printBTime]is
null And [LoanType]='" & "CC" & "'"
End if
For intPage = Application.Reports(strDocName).Pages To 1 Step -1
DoCmd.PrintOut acPages, intPage, intPage
Next intPage
DoCmd.Close acReport, strDocName
end sub
that they are about to x number of records of whatever criteria they choose.
If there are no records that match there criteria, then just go back to the
form no need to preview the report.
Private Sub Preview_Click()
Dim strDocName As String
Dim intPage As Integer
strDocName = "rptInvoice"
If Me.CustType.Column(0) = "<All Customers >" Then
DoCmd.OpenReport strDocName, acViewPreview
ElseIf Me.CustType.Column(0) = "<Mid W Cust>" Then
DoCmd.OpenReport strDocName, acViewPreview, , "[PrintBTime] is
null And [LoanType] ='" & "MWC" & "'"
ElseIf Me.CustType.Column(0) = "<Central Cust>" Then
DoCmd.OpenReport strDocName, acViewPreview, , "[printBTime]is
null And [LoanType]='" & "CC" & "'"
End if
For intPage = Application.Reports(strDocName).Pages To 1 Step -1
DoCmd.PrintOut acPages, intPage, intPage
Next intPage
DoCmd.Close acReport, strDocName
end sub