The Value property specifies the value of a window or report field. For window fields, the Value property is a read/write property. For report fields, the Value property is a read-only property unless the field is a user-defined calculated field.
field.Value [= string_value]
• field – A window field or report field object.
• string_value – A string specifying the value of the field.
If you omit the Value property from your code, VBA assumes you’re returning or setting the value of the field. The following example explicitly uses the Value property:
BatchID.Value = "DEBITMEMOS"
The same code can also omit the Value property and be written like this:
BatchID = "DEBITMEMOS"
The following table lists each field type for which you can set or return a value using the Value property, as well as a description of the string value used for the field type:
Field type |
Description |
---|---|
Button drop list |
A numeric value identifying the item selected in the list. |
Check box |
The value 0 indicating an unmarked check box. The value 1 indicating a marked check box. |
Combo box |
The text of the item selected in the combo box. |
Composite |
The value of the composite field, including any formatting. |
Currency |
A currency value for the field, including the decimal separator. |
Date |
The date value of the field, including any formatting. |
Drop-down list |
A numeric value identifying the item selected in the list. |
Integer |
The numeric value of the field, including any formatting. |
List box |
A numeric value identifying the item selected in the list. |
Long integer |
The numeric value of the field, including any formatting. |
Multi-select list box |
A 32-bit numeric value identifying the selected items in the list. |
Push button |
The value 0 indicating the “unpressed” state of the push button. The value 1 indicating the “pressed” state. |
Radio group |
A numeric value identifying the radio button selected in the group. |
String |
The string value for the field, including any formatting. |
Time |
The time value for the time field, including any formatting. |
Visual switch |
A numeric value identifying the item selected in the visual switch. |