The openform action was cancelled < Removing this message

rsteenoven

New member
Local time
Yesterday, 16:17
Joined
Nov 26, 2008
Messages
9
When I click a button that links to a macro that links to a query form thing, if I press cancel on the enter paramater box, this message is displayed.

the openform action was cancelled

How do i make it so that when I click the cancel button, this message does not appear?
 
When I click a button that links to a macro that links to a query form thing, if I press cancel on the enter paramater box, this message is displayed.

the openform action was cancelled

How do i make it so that when I click the cancel button, this message does not appear?

You will need to add Error trapping for Error Code 2501.
 
I just remembered that one of the BIG problems with using macros is that it is very difficult to add error handling.

I would urge you to convert th macro to VBA code then you can use something like:

Code:
Private Sub MyCommandButton_Click()

    On Error GoTo Err_MyCommandButton_Click

'
' you code here
'


Exit_MyCommandButton_Click:
    Exit Sub

Err_MyCommandButton_Click:
    If Err.Number = 2501 Then
        Resume Next  
    Else 
        MsgBox Err.Description
        Resume Exit_MyCommandButton_Click
    End if 
End Sub
 

Users who are viewing this thread

Back
Top Bottom