Use the properties: BoundColumn, DataSource, DataField, RowSource, and ListField.
In this example, the Companies table holds the names of companies and country codes. The Countries table maps the country codes to country names.
Companies:
Name
CountryID
Countries:
Name
ID
The program must display the Companies table but show the country name instead of its ID. To do that, the following DBCombo control properties were set at design time:
Property | Value | Purpose |
RowSource | datCountries | The Data control containing the names to be displayed |
ListField | Name | The field in RowSource to display |
DataSource | datCompany | The Data control holding the values to be updated (in this case, the Companies records) |
DataField | CountryID | The name of the field in DataSource that we will update |
The Data controls' properties are also set at design time to access the appropriate tables. The rest is automatic.
|