See Also Example
Applies To
Check box, command button
Description
Check box, option button
determines the state of the control.
Command button
determines whether the button is chosen; not available at design time.
Field object
determines the content of a field.
Horizontal and vertical scroll bars
determines the current position of the scroll bar, whose return value is always between the values for the Max and Min properties, inclusive.
Usage
{ [form.]control | field}.Value[ = setting ]
Setting
The Value property settings are:
Check box
0 is Unchecked (default), 1 is Checked, and 2 is Grayed (dimmed).
Command button
True indicates the button is chosen; False (the default), indicates the button is not chosen. Setting the Value property to True in code invokes the button's Click event.
Field object
restricted only by the Field data types .
Horizontal and vertical scroll bars
set values between
32,768 and 32,767 to position the scroll box.
Option button
True indicates the button is selected; False, the default, indicates the button is not selected.
Remarks
A default property of an object is assumed, and does not need to be specified in code. For example, Field is the default property of any Recordset, and Value is the default property of a Field object. This makes the two statements below equivalent:
Dn.Fields("PubID").Value = X
Dn.("PubID") = X
The first statement specifies the default properties; the second statement assumes them.
Data Type
Check box
Integer (Enumerated)
Command button, option button
Integer (Boolean)
Field objects
any one of the Field data types
Horizontal and vertical scroll bars
Integer
Help:
Max, Min Properties
Data Access
Programmer's Guide:
Chapter 3, "Creating and Using Controls"
The example displays a horizontal scroll bar's numeric value in a text box. To try this example, paste the code into the Declarations section of a form that has a text box and horizontal scroll bar. Press F5 to run the program and then click the scroll bar.
Sub Form_Load ()
HScroll1.Min = 0 ' Initialize scroll bar.
HScroll1.Max = 1000
HScroll1.LargeChange = 100
HScroll1.SmallChange = 1
End Sub
Sub HScroll1_Change ()
Text1.Text = Format (HScroll1.Value)
End Sub