| Fields, Parameters and Expressions > True DataControl Fields > Field Properties |
The Field object has the following properties that can be set at design time in the Fields property page, or in code at run time:
|
Specifies a unique name that identifies the field in True DataControl expressions and in the True DataControl recordset. It also serves as an index to the Fields collection, which is returned by the Fields property. The default name for a newly added field is FIELD_number, where number is the lowest integer that would yield a unique name. In order to be used directly in TData expressions, a field’s name must be a proper identifier, that is, it must begin with a letter and contain only letters, digits, and underscores. If you have a field with spaces or other non-identifier characters, you can use the Field() function in expressions, for example, Field(“A very important field”). |
|
|
Specifies the name of the SourceRecordset field from which this True DataControl field is derived. This property is only used by data fields (not calculated or linked fields) in data source mode. |
|
|
Specifies a user-friendly name under which the field appears in the Find Dialog. If not explicitly set, defaults to Name. |
|
|
For a linked field (FieldKind = 2 - Linked, LinkedField is the name of a field in the LinkedControl (a dependent TData control), to which the linked field is linked. For more information, see One-to-One Links. At design time, if the Linked option button is selected, the caption of the DataSource Field combo box changes to Linked Field. In this case, you must select one of the available field names (from a dependent TData control). |
|
|
Determines whether the field is exposed to data-aware controls. The default value is True. If set to False, the field can still be used by the TData control and all its dependent TData controls, but it is hidden from bound controls.the TData control and all its dependent TData controls can still use the field |
|
|
Determines whether the field can be modified by the end-user. The default value is False, which means that the field is modifiable. If True, the end-user cannot modify the field, but its value can still be changed in code or by evaluation of a True DataControl expression. |
|
|
Determines whether the field must be assigned an actual value when records are updated or added. The default value is False, which means that a value need not be specified. If set to True, an attempt to empty the field, or to update or add a record with this field empty will result in an error message. |
|
|
Determines whether the field is included in the Find Dialog. Default: True, the field is included. |
|
|
Determines the variant data type of the field. Allowable values are Boolean, Byte, Currency, Date, Double, Integer, Long, Single, String, Variant. For data fields in data source mode, and for linked fields in any mode, the value is derived from the underlying data source and the property cannot be changed. For calculated fields in data source mode, and for data fields in memory array or user events mode, the default value is String, but you can change the value to the appropriate type. |
|
|
For string fields only, this setting specifies the maximum number of characters the field value can contain. |
|
|
Determines how True DataControl reacts to changes in the field’s value caused by end-user interaction. When set to 0 - None, True DataControl does nothing, deferring to the container (Visual Basic) to decide when the field should be updated. The 1 - Immediate setting triggers an instant field update for every change that occurs in a bound control, even for individual keystrokes. The default setting, 2 - Leaving control, triggers field updates when the bound control loses focus, or when the current cell position in a bound grid changes. |
You can also specify the following optional expressions:
|
Specifies the expression used to calculate the field's value. This is normally used for calculated fields, but data fields can also have calculated expressions, in which case the field's value changes whenever one of the fields referenced in the expression changes. If the rules for calculating fields are too complex to be represented by an expression, you can use the CalcFields event to determine the values of calculated fields. |
|
|
(In the Fields property page, this property is represented by the Condition edit box beside Calculated Expression). Specifies a Boolean expression that determines whether the associated calculated expression should be evaluated at all. If the condition expression is empty or evaluates to True, the calculated expression will be evaluated; if the condition expression evaluates to False, the calculated expression will not be evaluated. |
|
|
|
One possible use of the condition expression is to initialize an empty data field with the value of another field that has just been modified. For example, to initialize the value of the BillTo field with the value of the ShipTo field when the latter has just been entered, you would set the former's calculated expression to ShipTo, and its associated condition expression to IsEmpty(BillTo). |
|
Specifies the default value to be assigned to this field in a newly added record. |
The following two properties define a field’s behavior in Query Mode.
|
Specifies whether the field should appear only in query mode, only in result mode, or in both modes. |
|
|
Specifies the comparison operation (=, <=, >=, <, >, starts with, contains) used with the field generating the query filter condition. |