Value Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
https://msdn.microsoft.com/en-us/library/cc349284(v=office.10)
Specifies the state or content of a given control.
Syntax
object.Value [= Variant]
The Value property syntax has these parts:
Part | Description |
---|---|
object | Required. A valid object. |
Variant | Optional. The state or content of the control. |
Settings
Control | Description |
---|---|
CheckBox | An integer value indicating whether the item is selected: |
Null Indicates the item is in a null state, neither selected nor . | |
1 True. Indicates the item is selected. | |
0 False. Indicates the item is cleared. | |
OptionButton | Same as CheckBox. |
ToggleButton | Same as CheckBox. |
ScrollBar | An integer between the values specified for the Max and Min properties. |
SpinButton | Same as ScrollBar. |
ComboBox, ListBox | The value in the BoundColumn of the currently selected rows. |
CommandButton | Always False. |
MultiPage | An integer indicating the currently active page. |
Zero (0) indicates the first page. The maximum value is one less than the number of pages. | |
TextBox | The text in the edit region. |
Remarks
For a CommandButton, setting the Value property to True in a macro or procedure initiates the button's Click event.
For a ComboBox, changing the contents of Value does not change the value of BoundColumn. To add or delete entries in a ComboBox, you can use the AddItem or RemoveItem method.
For a TextBox, any value you assign to the Text property is also assigned to the Value property.
Value cannot be used with a multi-select ListBox.