You can use the Value property to determine or specify if a control is selected, the selected value or option within the control, the text contained in a text box control, or the value of a custom property.
Setting
The Value property uses the following setting depending on the specified control.
Control | Setting | Description | Visual Basic |
---|---|---|---|
Check box | True
False |
The check box is selected.
(Default) The check box is cleared. |
True (–1)
False (0) |
Combo box | [The text in the text box portion of the control] | This may or may not be the same as the setting for the Text property of the control. The current setting for the Text property is what is displayed in the text box portion of the combo box; the Value property is set to the Text property setting only after this text is saved. | |
List box | [The list box item value] | The value in the bound column for the item selected in the list. | |
Option button | True
False |
The option button is selected.
(Default) The option button isn't selected. |
True
False |
Option group | [The OptionValue property setting] | The OptionValue property setting for the selected control in the group. | |
Text box | [The value of the control's Text property] | The Text property returns the formatted string. The Text property may be different than the Value property for a text box control. The Text property is the current contents of the control. The Value property is the saved value of the text box control. The Text property is always current while the control has the focus. | |
Toggle button | True
False |
The toggle button is pressed in.
The toggle button isn't pressed in. |
True
False |
Tab control | [An Integer value representing the index number of the currently selected Page object] | The Value property of a tab control contains the index number of the current Page object. There is one Page object for each tab in a tab control. The first Page object always has an index number of 0, the second has an index number of 1, and so on. | |
Bound object frame or chart control | The Value property for a bound object frame or a bound chart control is set to the value of the field that the control is bound to. Since these fields normally contain OLE objects or chart objects, which are stored as binary data, this value is usually meaningless. | ||
ActiveX control | Some ActiveX controls support the Value property. For example, the Value property setting for a Calendar control is the currently selected date in the control. For more information, see the documentation for each ActiveX control. | ||
Custom properties | A Long or string expression representing the value of the custom property. | The Value property of a custom property contains the value of the specified custom property of an AccessObject object. For more information about custom properties, see the topics about the AccessObject object, AccessObjectProperty object, and the AccessObjectProperties collection. |
You can set this property by using a macro or Visual Basic.
Remarks
Forms!frmCustomers!txtLastName = "Smith"
This means that the following two statements are equivalent.
Forms!frmCustomers!optCreditApproved.Value = True
Forms!frmCustomers!optCreditApproved = True
Note The Value property is not the same as the DefaultValue property, which specifies the value that a property is assigned when a new record is created.
CurrentProject.AllForms!optCreditApproved.Value = True
CurrentProject.AllForms!optCreditApproved = True