You can use the StopMacro action to stop the currently running macro.
Setting
The StopMacro action doesn't have any arguments.
Remarks
You typically use this action when a condition makes it necessary to stop the macro. You can use a conditional expression in the macro's action row that contains this action. When the expression evaluates to True (–1), Microsoft Access stops the macro.
For example, you might create a macro that opens a form showing the daily order totals for the date entered in a custom dialog box. You could use a conditional expression to be sure that the Order Date control on the dialog box contains a valid date. If it doesn't, the MsgBox action can display an error message and the StopMacro action can stop the macro.
If the macro has used the Echo or SetWarnings actions to turn echo or the display of system messages off, the StopMacro action automatically turns them back on.
This action isn't available in Visual Basic.