Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


1072


TABLE 30.6 (continued)
Macro Name Action Action Argument Action Argument Setting
Beep Yes
Type Information
Title Division Example
RunMacro Macro Name mcrDivisionErrorHandling.
Cleanup
ErrorHandler MessageBox Message =“The following error
occurred: “ & [MacroError].
[Description]
Beep Yes
Type Warning?
Title =“Error Number: “ &
[MacroError].[Number]
ClearMacroError
RunMacro Macro Name mcrDivisionErrorHandling.
Cleanup
Cleanup RemoveTempVar Name MyNum
RemoveTempVar Name MyDenom

FIGURE 30.17

mcrDivisionErrorHandling uses the OnError action to display a user-friendly error message and
remove the temporary variables.


Setting up an error handler

Name of error handler

Error handler submacro

Collapsed macro actions
Free download pdf