What am I doing wrong here?

scottk

Registered User.
Local time
Today, 17:03
Joined
Aug 20, 2001
Messages
29
What am I doing wrong here?

I am trying to create a data lookup that will return the county when I enter the zip code.

I have a table with information on our clients, names and addresses and phone numbers) and a table that contains every zip code in the state and the counties that the zip code is in.

The form is based off of the Clients table. I have made a combo box named zip code. Using the wizard I selected the Zip Code and Counties fields from the Zip Code Table. I selected that I would like the data stored in the Zip Code filed of the Clients table.

I then created an unbound text box called County on the form.

I placed the following code in the AfterUpdate property of the Zip Code combobox:

Me.County = ComboBox.Column(1)

Now I thought this should fill in the County Data automatically, however when I update the zip code I receive a run time error and when I select debug I am returned taken to this line of code.

What is going wrong?

Also, can I select the County field on the Control Source of the County text box so that the County is stored in that field in the Clients table?
 
Since zip codes is a look up table you shouldn't store the zip or the county in the clients table only the unique ID of the zip. The way you are doing it at the moment if the zip codes are changed you will have to update every field in your clients table, instead of just one field in the zip table.
HTH
 

Users who are viewing this thread

Back
Top Bottom