Visual Basic Concepts
One of the features of the Data Environment is that it allows you to drag fields from the Data Environment onto a form or report. When you are designing a Data Environment, you can specify what control is created when the field is dropped based on the data type of the field. For example, you can have a Spin Edit Control created for all integer types. You can also specify a specific control on a per-field basis.
There are three levels of controls that you can specify. When a field is dropped onto a form, the Data Environment looks for a control in the order described in the following table. The first level that has a control associated with it is used.
Control Level | Description |
Field Object | Within a DataEnvironment object, a control can be directly associated with a Field object in a Command object. The control is specified as a property of the Field object and is only applicable to that specific field.
If no control is specified for the dropped Field object, the Data Environment moves to the next level: ADO Data Type. |
ADO Data Type | A control can be associated with a specific ADO data type. For example, a control can be associated with the ADO data type adTinyInt. Thus, whenever a field of this type is dropped on the form (and it does not have a control associated with the Field object), the control associated with the ADO data type is created.
Note These settings will affect all DataEnvironment objects on your system. If no control is associated with the specific ADO data type, the Data Environment moves to the next level: Field Type Categories. |
Field Type Categories | Since there are a large number of ADO data types that store similar data, a set of Field Type categories are defined. For example, all integer-related data types (such as adBigInt, adTinyInt, and so forth) are combined into a Field Type category of Integer. If no control is associated with the specific ADO data type, the control associated with the Field Type that contains the ADO data type is used.
If there is no control associated with the Field Type category, the system defaults to an intrinsic TextBox control. |
There are two special Field Type categories: Caption and Multiple. The control associated with Caption is the control used when a label object is created next to a new control. The control associated with Multiple appears when you complete a right-drag of a Command object, and is typically used to specify a grid control.
The following procedures describe how to set field mapping information for your drag and drop controls.
To change the Caption control for a single Field object
To change the Caption control for more than one Field object at a time
-or-
Right-click your DataEnvironment object and click Options on the shortcut menu.
To specify an ADO Data Type or Category control
-or-
Right-click your DataEnvironment object and click Options on the shortcut menu.
Control | Description |
ADO Data Type | Select a Data Type (for example, adBinary) from the Default Control Association list, and then associate it with a Control list item. |
Category | Select a Category (for example, Binary) from the Default Control Association list, and then associate it with a Control list item. |
To prevent the creation of labels for Field objects
-or-
Right-click your DataEnvironment object and choose Options from the shortcut menu.