Form.CommandBeforeExecute Event
Access Developer Reference |
Occurs before a specified command is executed. Use this event when you want to impose certain restrictions before a particular command is executed.
Syntax
expression.CommandBeforeExecute(Command, Cancel)
expression A variable that represents a Form object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Command | Required | Variant | The command that is going to be executed. |
Cancel | Required | Object | Set the Value property of this object to True to cancel the command. |
Return Value
nothing
Remarks
The OCCommandId, ChartCommandIdEnum, and PivotCommandId constants contain lists of the supported commands for each of the Microsoft Office Web Components.
Example
The following example demonstrates the syntax for a subroutine that traps the CommandBeforeExecute event.
Visual Basic for Applications |
---|
|