G
Guest
This code produces a TYPE MISMATCH error for strMode on both OpenReport
lines. The MsgBox return shows the parameters appear to be passed correctly.
What is wrong??
Call PrintScoreSheets(7, "Event Name", "acPreview")
Public Sub PrintScoreSheets(intEvent As Integer, strEvent As String, strMode
As String)
If intEvent <> 11 Then
'Print Score sheets
MsgBox intEvent & " " & strEvent & " " & strMode & " 2"
DoCmd.OpenReport "Score Sheets", strMode, "", ""
End If
If intEvent = 11 Then
MsgBox intEvent & " " & strEvent & " " & strMode & " 3"
'Print Duet Score sheets
DoCmd.OpenReport "Score Sheets (Duets)", strMode, "", ""
End If
End Sub
The following work-around works just fine from the same CALL as above so I
am fairly certain that the parameters are being passed correctly. HELP
Public Sub PrintScoreSheets(intEvent As Integer, strEvent As String, strMode
As String)
If (intEvent) <> 11 Then
'Print Score sheets
MsgBox intEvent & " " & strEvent & " " & strMode & " 2"
If strMode = "acNormal" Then
DoCmd.OpenReport "Score Sheets", acNormal, "", ""
End If
If strMode = "acPreview" Then
DoCmd.OpenReport "Score Sheets", acPreview, "", ""
End If
End If
If (intEvent) = 11 Then
'Print Score sheets
MsgBox intEvent & " " & strEvent & " " & strMode & " 3"
If strMode = "acNormal" Then
DoCmd.OpenReport "Score Sheets (Duets)", acNormal, "", ""
End If
If strMode = "acPreview" Then
DoCmd.OpenReport "Score Sheets (Duets)", acPreview, "", ""
End If
End If
lines. The MsgBox return shows the parameters appear to be passed correctly.
What is wrong??
Call PrintScoreSheets(7, "Event Name", "acPreview")
Public Sub PrintScoreSheets(intEvent As Integer, strEvent As String, strMode
As String)
If intEvent <> 11 Then
'Print Score sheets
MsgBox intEvent & " " & strEvent & " " & strMode & " 2"
DoCmd.OpenReport "Score Sheets", strMode, "", ""
End If
If intEvent = 11 Then
MsgBox intEvent & " " & strEvent & " " & strMode & " 3"
'Print Duet Score sheets
DoCmd.OpenReport "Score Sheets (Duets)", strMode, "", ""
End If
End Sub
The following work-around works just fine from the same CALL as above so I
am fairly certain that the parameters are being passed correctly. HELP
Public Sub PrintScoreSheets(intEvent As Integer, strEvent As String, strMode
As String)
If (intEvent) <> 11 Then
'Print Score sheets
MsgBox intEvent & " " & strEvent & " " & strMode & " 2"
If strMode = "acNormal" Then
DoCmd.OpenReport "Score Sheets", acNormal, "", ""
End If
If strMode = "acPreview" Then
DoCmd.OpenReport "Score Sheets", acPreview, "", ""
End If
End If
If (intEvent) = 11 Then
'Print Score sheets
MsgBox intEvent & " " & strEvent & " " & strMode & " 3"
If strMode = "acNormal" Then
DoCmd.OpenReport "Score Sheets (Duets)", acNormal, "", ""
End If
If strMode = "acPreview" Then
DoCmd.OpenReport "Score Sheets (Duets)", acPreview, "", ""
End If
End If