G
Guest
I have the following code that is executed from a form that should print odd
or even pages but get a type mismatch at the Reports![Print...] command line.
What am I doing wrong?
Private Sub btnEvenOdd_Click()
Dim strRptName As String
Dim strPrompt1 As String, strPrompt2 As String
Dim strResponse As String
Dim strFullPrompt As String
Dim strTitle As String
strPrompt1 = "Enter Odd or Even to print the "
strPrompt2 = " Report"
strTitle = "Print Odd OR Event Paged Report"
strRptName = Me.lstReports
strFullPrompt = strPrompt1 & strRptName & strPrompt2
Select Case strRptName
Case "Testing"
strReponse = UCase(InputBox(strFullPrompt, "Print Reports"))
DoCmd.OpenReport "rptTesting", acViewPreview
If strResponse = Even Then
Reports![Print Odd Even Pages]![PrintPages] = "Even" And Page
Mod 2 = 1
DoCmd.Close "rptTesting"
Else
Reports![Print Odd Even Pages]![PrintPages] = "Odd" And Page Mod
2 = 0
DoCmd.Close "rptSongsByTitle"
End If
End Select
End Sub
or even pages but get a type mismatch at the Reports![Print...] command line.
What am I doing wrong?
Private Sub btnEvenOdd_Click()
Dim strRptName As String
Dim strPrompt1 As String, strPrompt2 As String
Dim strResponse As String
Dim strFullPrompt As String
Dim strTitle As String
strPrompt1 = "Enter Odd or Even to print the "
strPrompt2 = " Report"
strTitle = "Print Odd OR Event Paged Report"
strRptName = Me.lstReports
strFullPrompt = strPrompt1 & strRptName & strPrompt2
Select Case strRptName
Case "Testing"
strReponse = UCase(InputBox(strFullPrompt, "Print Reports"))
DoCmd.OpenReport "rptTesting", acViewPreview
If strResponse = Even Then
Reports![Print Odd Even Pages]![PrintPages] = "Even" And Page
Mod 2 = 1
DoCmd.Close "rptTesting"
Else
Reports![Print Odd Even Pages]![PrintPages] = "Odd" And Page Mod
2 = 0
DoCmd.Close "rptSongsByTitle"
End If
End Select
End Sub