Setting field value based on info in a second table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have two tables I am working with. One (table 1) includes 444 zip codes,
and each zip code is assigned a region code. There are 7 region codes for all
444 zip codes. In my second table (table 2), I have customer info, including
their zip code. I would like to set the value of the region code field based
on the zip. Is there any way to automate this? Basically I want to do
something that says match the zipcode on table 2 to the zipcode on table 1,
and fill in the region code on table 2, based on the value in the region
field in table 1.

This data will be updated continously, so I'd also like this region code to
be automatically filled in when a new customer is entered in table 2. If
updates are made to the regions in table 1, I would like table 2 to
automatically reflect that.

I'm very new to Access, so I have no idea what to do. Should I write a
macro, an IIF statement? Any help would be greatly appreciated.
 
Make a Query.

Add the 2 tables and join them (based on the zip code), doubleclick the line
between the 2 tables (this is called the join).
en choose "all records from customers and only those records from
zip-table..."

Add the field you want to see from the customer table and the regioncode
from the zip table.

If you view the query in datasheet-mode, you'll see that everything is
automatically linked.

Kind Regards
Damiaan
info at dampee.be
http://www.dampee.be
 
Thank you so much! This works great.

Andrea

Damiaan said:
Make a Query.

Add the 2 tables and join them (based on the zip code), doubleclick the line
between the 2 tables (this is called the join).
en choose "all records from customers and only those records from
zip-table..."

Add the field you want to see from the customer table and the regioncode
from the zip table.

If you view the query in datasheet-mode, you'll see that everything is
automatically linked.

Kind Regards
Damiaan
info at dampee.be
http://www.dampee.be
 
Back
Top