Form.CommandChecked event (Access)

Occurs when the specified Microsoft Office web component determines whether the specified command is selected.

Syntax

expression.CommandChecked (Command, Checked)

expression A variable that represents a Form object.

Parameters

Name Required/Optional Data type Description
Command Required Variant The command that has been verified as being selected.
Checked Required Object Set the Value property of this object to False to clear 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 CommandChecked event.

Private Sub Form_CommandChecked( _ 
 ByVal Command As Variant, ByVal Checked As Object) Dim intResponse As Integer 
 Dim strPrompt As String 
 
 strPrompt = "Uncheck the command?" 
 
 intResponse = MsgBox(strPrompt, vbYesNo) 
 
 If intResponse = vbYes Then 
 Checked.Value = False 
 Else 
 Checked.Value = True 
 End If 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.