ControlSource Property

Applies To   See Also

Specifies the source of data to which an object is bound. Available at design time and run time.

Syntax

Object.ControlSource[ = cName]

Settings

cName

For controls, cName is a variable or field.

Remarks

Once the ControlSource property is set to a field or variable, the Value property always has the same data value and the same data type as the variable or field to which the ControlSource property is set.

For TextBox controls, cName is typically a field.

In a Grid control, if you do not specify a ControlSource setting for a column, the column displays the next available undisplayed field of the grid's record source.

If a Column's Bound property is set to true (.T.), the Column's ControlSource property setting applies to the column and any controls contained in it. If you attempt to set the contained control's ControlSource property, an error occurs. If a Column's Bound property is set to false (.F.), you can set the ControlSource property of a contained control directly. If you subsequently set the ControlSource setting of the Column, it overrides the ControlSource setting of the contained control.