The component’s current value.

Property of

CheckBox, ColumnEditor, ComboBox, Editor, Entryfield, ListBox, Progress, PushButton, RadioButton, ScrollBar, Slider, SpinBox

Description

A component’s value property reflects its value, which is

The value that is displayed in a ColumnEditor, Entryfield, Editor, SpinBox, or ComboBox component

true if a CheckBox component is checked; false if it’s not checked

true if a RadioButton component is the one in its group that is selected; false if it’s not selected

The item that has focus in a ListBox component

The interpolated number for the current position in a Slider, Progress, or ScrollBar object.

true if a toggle PushButton is down; false if it’s up

Both field and component objects have a value property. (Fields in a table open in a work area do not have any properties, but they have a value; the concept is the same). When they are dataLinked, changes in one object’s value property are echoed in the other. The form component’s value property reflects the value displayed in the component at any given moment. If the component’s value is changed, it is copied into the field.

The value property for all fields in a rowset is set when you first open a query, and updated as you navigate from row to row. The value properties for components dataLinked to those fields are also updated at the same time, unless the rowset’s notifyControls property is set to false. You can also force the components to be updated by calling the rowset’s refreshControls( ) method, which is useful if you have set a field’s value property through code.

When reading or writing values to dataLinked components, you can use the value property of either the visual component or the field object; there’s no difference, although you should be consistent. You may choose to program the visual interface, if the underlying data is more likely to change; or you might choose to work with the data objects, so you don’t have to worry about the names of the form components and whether they’re correctly dataLinked. In general, it’s easier and more portable for data object events to access the fields, so you’re more likely to assign to the value properties of the fields.

When the multiple property of a ListBox component is set to true, the "item that has focus", and subsequently determines the value of the value property, is the most recently selected, or unselected, item. Do not assume an item has focus because it is the last highlighted item on a list or because it was the most recently highlighted item. For example, suppose you have a ListBox containing options 1 through 4 which are then selected in the order 1, 4, and 2. Although the last highlighted item on the list is selection 4, the value property would be determined by the value of option 2, the last selected option. In the event that option 1 is then unselected, it would receive focus and determine the value of the value property even though it is not one of the highlighted items.