I'm working in 2002 Developer on a 2000 file.
I'm creating reports and have a form where the user delineates a variety of criteria then clicks either a PREVIEW or PRINT button.
Preview button includes: CreateReports ("Preview")
Print button includes: CreateReports ("Normal")
Elsewhere in the form's module I have a module:
Private Sub CreateReports(PrintOrPreview As String)
... (irrelevant lines removed)
Select Case PrintOrPreview
Case "Preview"
DoCmd.OpenReport strNewReport, acViewPreview, , , acHidden
Case "Normal"
DoCmd.OpenReport strNewReport, acViewNormal, , , acHidden
End Select
If PrintOrPreview = "Preview" Then Reports(strNewReport).Visible = True
...(irrelevant lines removed)
end sub
When Access 2000 users click Preview, the code hangs up on the docmd.openreport line saying it can't compile the module.
I suspect the problem is with my PrintOrPreview variable.
Does anyone have any suggestions for how I can fix this code to work in 2000 while keeping this basic approach? Alternatively I'm thinking about a module-scope variable to hold "print" or "preview" value. I sure appreciate any help!!!!
I'm creating reports and have a form where the user delineates a variety of criteria then clicks either a PREVIEW or PRINT button.
Preview button includes: CreateReports ("Preview")
Print button includes: CreateReports ("Normal")
Elsewhere in the form's module I have a module:
Private Sub CreateReports(PrintOrPreview As String)
... (irrelevant lines removed)
Select Case PrintOrPreview
Case "Preview"
DoCmd.OpenReport strNewReport, acViewPreview, , , acHidden
Case "Normal"
DoCmd.OpenReport strNewReport, acViewNormal, , , acHidden
End Select
If PrintOrPreview = "Preview" Then Reports(strNewReport).Visible = True
...(irrelevant lines removed)
end sub
When Access 2000 users click Preview, the code hangs up on the docmd.openreport line saying it can't compile the module.
I suspect the problem is with my PrintOrPreview variable.
Does anyone have any suggestions for how I can fix this code to work in 2000 while keeping this basic approach? Alternatively I'm thinking about a module-scope variable to hold "print" or "preview" value. I sure appreciate any help!!!!