zipcodes, countries and that kind of stuff

dvdeelen

New member
Local time
Today, 13:42
Joined
Oct 5, 2002
Messages
5
i have an table with zipcode - place - region - country, with the combination of zipcode and place as a primary key

in the table clients i refer to this table (for my addresses)

i have a form, based on the table clients, in which i insert new clients

now i want two things:
1) when i add a new client with a zipcode - place that's allready in my zipcode tabel, i want to be able to select the zipcode, select one of the possible places, automatically fill the region and the country

2) when the combination of zipcode and place is not in the zipcode tabel, i want to add this combination including the region and the country.

Can someone please help me?
 
Set up a select query that combines the zipcode and place into a single calculated field, and also includes the region and country fields. On your form, add a combo box with the RowSource set to this query, 3 columns, and the BoundColumn set to the position of the calculated field. You can use the combo box's AfterUpdate event procedure to populate the form's region and country fields, like this:

txtRegion = MyCombo.Column(1)
txtCountry = MyCombo.Column(2)

This assumes that the calculated column (Column(0)) is first, the region column is second and the country column is third.

To allow entry of new zipcode/place combinations, set the combo box's LimitToList property to No, and use its NotInList event procedure to handle the addition of the new record and the subsequent requerying of the combo box.
 

Users who are viewing this thread

Back
Top Bottom