다음을 통해 공유


Form.CommandEnabled Event (Access)

Occurs when the specified Microsoft Office Web Component determines whether the specified command is enabled.

Syntax

.CommandEnabled(Command, Enabled)

A variable that represents a Form object.

Parameters

Name

Required/Optional

Data Type

Description

Command

필수

Variant

The command that has been verified as being enabled.

Enabled

필수

Object

Set the Value property of this object to False to disable 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 CommandEnabled event.

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

참고 항목

개념

Form Object

Form Object Members