A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Search on one field & fill in the correct matching record



 
 
Thread Tools Display Modes
  #1  
Old December 5th, 2009, 05:12 PM posted to microsoft.public.access.tablesdbdesign
Ron
external usenet poster
 
Posts: 690
Default Search on one field & fill in the correct matching record

Using Access 2003 I created a table called tblcustomer. The table has seven
fields: *CustomerID, Fname, Lname, Address, City, State, & Zip. When entering
a customer record I would like to be able to select the zip code in a drop
down list box. Once the zip code is selected I would like to be able to save
the correct matching city, state & zip for that record in the tblcustomer.
Since all my customers are local there is a lot of redundentcy on the city,
state & zip fields. I thought it would be best to have seperate tables for
these fields - tblcity, tblstate, tblzip. I now need a table to match up the
correct zipcode to city & state. The table is called tblctystzp. The fields
in this table are *ctystzpID, city, state & zip. Each one of these fields can
select the correct info from a drop down box which is reference to tblcity,
tblstate & tblzip. Should I NOT have the city, state & zip fields in the
tblcustomer and only a reference from each record in the tblcustomer to
tblcitystzp. The relationship between the tblcustomer & tblctystzp tables
will be a many to many, so I now need a junction table. Am I going about this
the correct way?
  #2  
Old December 5th, 2009, 05:30 PM posted to microsoft.public.access.tablesdbdesign
Ken Snell
external usenet poster
 
Posts: 177
Default Search on one field & fill in the correct matching record

Don't store city, state, etc. in your tblCustomer table. Use the zipcode
field to link to those data. You don't need to store redundant data (city,
state) in two tables.

--

Ken Snell
http://www.accessmvp.com/KDSnell/


"Ron" wrote in message
...
Using Access 2003 I created a table called tblcustomer. The table has
seven
fields: *CustomerID, Fname, Lname, Address, City, State, & Zip. When
entering
a customer record I would like to be able to select the zip code in a drop
down list box. Once the zip code is selected I would like to be able to
save
the correct matching city, state & zip for that record in the tblcustomer.
Since all my customers are local there is a lot of redundentcy on the
city,
state & zip fields. I thought it would be best to have seperate tables for
these fields - tblcity, tblstate, tblzip. I now need a table to match up
the
correct zipcode to city & state. The table is called tblctystzp. The
fields
in this table are *ctystzpID, city, state & zip. Each one of these fields
can
select the correct info from a drop down box which is reference to
tblcity,
tblstate & tblzip. Should I NOT have the city, state & zip fields in the
tblcustomer and only a reference from each record in the tblcustomer to
tblcitystzp. The relationship between the tblcustomer & tblctystzp tables
will be a many to many, so I now need a junction table. Am I going about
this
the correct way?



  #3  
Old December 5th, 2009, 05:33 PM posted to microsoft.public.access.tablesdbdesign
Lynn Trapp[_4_]
external usenet poster
 
Posts: 9
Default Search on one field & fill in the correct matching record

Ron,
There are no triggers in Access tables, so there is nothing to cause those
updates to automatically happen. However, if you have a separate table to
store the city and state information, then it can be related to the customer
table as you have suggested. all you will need to store in the customer
table is the Zip Code field, then you can use the combobox as you suggested
and query the 2 tables to get the full information.

--
Lynn Trapp
Trainer/Application Developer


"Ron" wrote in message
...
Using Access 2003 I created a table called tblcustomer. The table has
seven
fields: *CustomerID, Fname, Lname, Address, City, State, & Zip. When
entering
a customer record I would like to be able to select the zip code in a drop
down list box. Once the zip code is selected I would like to be able to
save
the correct matching city, state & zip for that record in the tblcustomer.
Since all my customers are local there is a lot of redundentcy on the
city,
state & zip fields. I thought it would be best to have seperate tables for
these fields - tblcity, tblstate, tblzip. I now need a table to match up
the
correct zipcode to city & state. The table is called tblctystzp. The
fields
in this table are *ctystzpID, city, state & zip. Each one of these fields
can
select the correct info from a drop down box which is reference to
tblcity,
tblstate & tblzip. Should I NOT have the city, state & zip fields in the
tblcustomer and only a reference from each record in the tblcustomer to
tblcitystzp. The relationship between the tblcustomer & tblctystzp tables
will be a many to many, so I now need a junction table. Am I going about
this
the correct way?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.