I need help with a simple Access 2000 form that opens several reports. I would like the menu to always stay in the background and the reports to display maximized in the front of the menu. And as the reports are closed the menu will be visible.
Here is the code I have that opens the reports and closes the menu.
Code:
Private Sub Preview_Click()
On Error GoTo Err_Preview_Click
If (Forms![Menu]!selectCategory) = "View All Discharged Clients" Then
DoCmd.OpenReport "RptDischarged", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "View All Currently Enrolled Clients" Then
DoCmd.OpenReport "RptEnrolled", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "View All FA Discharged Clients" Then
DoCmd.OpenReport "RptFAdischarged", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "View All Follow Along Clients" Then
DoCmd.OpenReport "RptFollowAlong", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "View All Intake Clients" Then
DoCmd.OpenReport "RptIntake", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "View All Nonadmitted Clients" Then
DoCmd.OpenReport "RptNotAdmitted", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "Search IFSP Dts to Build a Custom Rpt" Then
DoCmd.OpenQuery "QRYPIVOT", acViewPivotTable, acReadOnly
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "Search Database by Ref Date Range" Then
DoCmd.OpenReport "RptRefDate", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "Search Database by Date of Birth Range" Then
DoCmd.OpenReport "RptDOB", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "Search by Disposition Date Range" Then
DoCmd.OpenReport "RptDisposDte", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "Search by Last Contact Date Range" Then
DoCmd.OpenReport "RptIntContactDate", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "All Client Mailing Labels" Then
DoCmd.OpenReport "All Client Mailing Labels", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
If (Forms![Menu]!selectCategory) = "Active Client Mailing Labels" Then
DoCmd.OpenReport "Active Client Mailing Labels", acViewPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End If
DoCmd.Close acForm, Me.Name
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
MsgBox Err.Description
Resume Exit_Preview_Click
End Sub
NewWM