How to catch "Action Failed" macro error so that the Halt dlg doesn't show

  • Thread starter Thread starter FrankBooth
  • Start date Start date
F

FrankBooth

Hi,

I have a Find macro that uses an InputBox (not Application.InputBox)
as the parameter. When I click Cancel to the inputbox I receive the
"Action FAiled" HALT dialog. I do not want this to come up, I just
want it to go back to the main app.

How do I catch this error?

Thanks in advance.

--FB
 
Test the value returned by the InputBox for an empty string (""). If it is
an empty string, then have your macro end and go back to where you want to
go.
 
I'd try it with code.

In the OnClick property line, right click to get the
Build... option and select EventProcedure. When the VB
window opens, use this code:


Private Sub Command1_Click()
On Error GoTo Err_Command0_Click
DoCmd.OpenQuery "qry_MyQuery", acViewNormal
Err_Command0_Click:
Exit Sub


End Sub
 
Back
Top