I have a number of buttons that open reports based on parameter values entered by the user. If the user clicks on cancel in the parameter value dialog box, I get Run-time error '2501' The OpenReport Action was cancelled.
In order to not have this dialog box appear added an OnError Resume Next line. Is there a better way to do this?
Code:Private Sub VocabButton_Click() On Error Resume Next DoCmd.OpenReport "Vocab Questions", acViewReport End Sub