L
Lillian
I need some help with this code that I need to use.
I hope it is easy enough to be understood.
The problem is I want to use a variable strTemp for the acViewPreview on
the DoCmd line below. I think it is the Dim that is causing a type
missmatch error.
Dim strTemp as string
RetValue = MsgBox("Preview Reports that have been checked? Click Yes to
Preview or No to Print", vbYesNo)
If RetValue = 6 Then
Set strTemp = acViewPreview
GoTo Continue
End If
Set strTemp = acViewNormal
Continue:
' DoCmd.OpenReport "rptEndOfMonthALL", acViewPreview
DoCmd.OpenReport "rptEndOfMonthALL", strTemp
GoTo Exit_Error_Click
I hope it is easy enough to be understood.
The problem is I want to use a variable strTemp for the acViewPreview on
the DoCmd line below. I think it is the Dim that is causing a type
missmatch error.
Dim strTemp as string
RetValue = MsgBox("Preview Reports that have been checked? Click Yes to
Preview or No to Print", vbYesNo)
If RetValue = 6 Then
Set strTemp = acViewPreview
GoTo Continue
End If
Set strTemp = acViewNormal
Continue:
' DoCmd.OpenReport "rptEndOfMonthALL", acViewPreview
DoCmd.OpenReport "rptEndOfMonthALL", strTemp
GoTo Exit_Error_Click