Message Box

  • Thread starter Thread starter Haigy
  • Start date Start date
H

Haigy

in the No Data event for a report i have a msgbox that informs that there is
no data, when you click on ok on the message box i get another message box

The OpenReport action was canceled

is there a way to stop this showing

thanks
 
Haigy said:
in the No Data event for a report i have a msgbox that informs that there is
no data, when you click on ok on the message box i get another message box

The OpenReport action was canceled

is there a way to stop this showing

Your code that opens the report needs to trap for errors. Then your error handler
can be set up to ignore error number 2501 (raised whenever a DoCmd... is cancelled).

On Error GoTo ErrHandler

DoCmd.OpenReport "SomeReport"

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
Normal Error Handling Goes Here
End Select
Resume Egress
End Sub
 
Back
Top