Carl Willems
2011-03-04 12:02:15 UTC
Hi,
in my relational database I have defined customers. In a related column I
have ZIP codes and a city name. The idea is to have a form with the
customer's data on which there is a combobox in which the user can select a
ZIP code, the combobox will then show the city name. In MSAccess this is
peanuts. In VB2010 the only thing I achieve is frustration.
What did I do so far:
In a datasource, I see the Customer table with the ZIPCode field that I
defined as Combobox. That I placed on the form, clicked on the placeholder
and changed the properties to:
- Datasource = ZIPandCity Bindingsource (this is the table containing ZIP
and Cities, obviously...)
- Display member = City
- Value member = ZIP
- Selected Value = ZIP (the one in the Customer table, linked it from the
Dataset instead of Bindingsource)
Played around with this, changing from dataset to bindingsource and back, I
also changed the (Databindings) properties in the Properties window and used
all possible combinations for SelectedItem, SelectedValue and Text, but I
don't seem to find the ones I need.
Google doesn't provide me a solution either, so I turn to this newsgroup.
Hope someone can help,
Kind regards,
Carl
in my relational database I have defined customers. In a related column I
have ZIP codes and a city name. The idea is to have a form with the
customer's data on which there is a combobox in which the user can select a
ZIP code, the combobox will then show the city name. In MSAccess this is
peanuts. In VB2010 the only thing I achieve is frustration.
What did I do so far:
In a datasource, I see the Customer table with the ZIPCode field that I
defined as Combobox. That I placed on the form, clicked on the placeholder
and changed the properties to:
- Datasource = ZIPandCity Bindingsource (this is the table containing ZIP
and Cities, obviously...)
- Display member = City
- Value member = ZIP
- Selected Value = ZIP (the one in the Customer table, linked it from the
Dataset instead of Bindingsource)
Played around with this, changing from dataset to bindingsource and back, I
also changed the (Databindings) properties in the Properties window and used
all possible combinations for SelectedItem, SelectedValue and Text, but I
don't seem to find the ones I need.
Google doesn't provide me a solution either, so I turn to this newsgroup.
Hope someone can help,
Kind regards,
Carl