D
Denny G.
Access 2002. I have code behind a form containing a list
box where when I dbl click on one of the items in the
list, only a report opens using the following code:
Private Function Preview()
On Error GoTo Preview_Err
If IsNull([ReportsList]) Or [ReportsList] = "" Then
MsgBox "You must select a report", 16, "Error"
DoCmd.GoToControl "ReportsList"
Exit Function
End If
DoCmd.OpenReport Me![ReportsList].Column(2),
acViewPreview
DoCmd.Maximize
Preview_Exit:
Exit Function
Preview_Err:
Select Case Err
Case 2501
Case 2202
MsgBox Error$
Case Else
MsgBox "Previewing report was Cancelled",
0, "Notice"
End Select
Resume Preview_Exit
End Function
How can I revise this code to force it to open either/or a
report or a FORM?
The reason I want to do this is that one of my reports has
a date parameter where I need to open a "Query-by-form"
first to input the date range for the subsequent report.
I would appreciate any help. Thank-you
box where when I dbl click on one of the items in the
list, only a report opens using the following code:
Private Function Preview()
On Error GoTo Preview_Err
If IsNull([ReportsList]) Or [ReportsList] = "" Then
MsgBox "You must select a report", 16, "Error"
DoCmd.GoToControl "ReportsList"
Exit Function
End If
DoCmd.OpenReport Me![ReportsList].Column(2),
acViewPreview
DoCmd.Maximize
Preview_Exit:
Exit Function
Preview_Err:
Select Case Err
Case 2501
Case 2202
MsgBox Error$
Case Else
MsgBox "Previewing report was Cancelled",
0, "Notice"
End Select
Resume Preview_Exit
End Function
How can I revise this code to force it to open either/or a
report or a FORM?
The reason I want to do this is that one of my reports has
a date parameter where I need to open a "Query-by-form"
first to input the date range for the subsequent report.
I would appreciate any help. Thank-you