I have a button on a form to open a report and error handling (connected to there being no data in the report if I remember rightly) as follows:
Select Case Err.Number
MsgBox “Error Number “& Err.Number & vbCrLf & “Error Description: “ &
Err.Description, vbOKOnly + vbExclamation, “Error”
If there is no data for the report a message pops up advising this.
I have now added the following to the open report code:
DoCmd.RunCommand ac CmdFitToWindow
I still get the message advising there is no data to create the report but now when I click on OK I get the following message:
Error description: The command or action 'FitToWindow' isn't available now.
How do I add this error to the other one so I don't get this message?