scouser
Registered User.
- Local time
- Today, 19:47
- Joined
- Nov 25, 2003
- Messages
- 767
I have a main switchboard 'frmMainMenu'. I have a series of cmdbuttons that call various reports. These were working OK. If the report was blank it envoked the 'On No Data' event of the report. However the Access default message then displayed 'The openReportAction was cancelled'. To stop this I have tried to implement 'Stormin Normans' code:
This works but now how I want frmMainMenu to close when the report is displayed. Then when the report is closed I want the user to be returned to frmMainMenu?
I thought the following in the above would close the main menu:
Alas the report opens to the side of the main menu?
Any ideas?
Cheers,
Phil.
Code:
Private Sub cmdOK_Click()
On Error GoTo Err_RunReport
DoCmd.OpenReport "rprtOrderAnalysisByServiceType", acViewPreview
DoCmd.Close acForm, Me.Name
Exit_RunReport:
Exit Sub
Err_RunReport:
Select Case Err.Number
Case 2501 'There were no records, so close this report, run the next!
Resume Next
Case Else
MsgBox Err.Number & ": " & Err.Description, , "ERROR " & Err.Source
End Select
Resume Exit_RunReport
End Sub
This works but now how I want frmMainMenu to close when the report is displayed. Then when the report is closed I want the user to be returned to frmMainMenu?
I thought the following in the above would close the main menu:
Code:
DoCmd.Close acForm, Me.Name
Alas the report opens to the side of the main menu?
Any ideas?
Cheers,
Phil.