dbTalk Databases Forums  

Zip Code and City

comp.database.ms-access comp.database.ms-access


Discuss Zip Code and City in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
djm
 
Posts: n/a

Default Zip Code and City - 11-07-2003 , 10:51 PM






I have a table and a form with about 100 zip codes and their corresponding
cities. I have another table and form that will contain each person's full
address. To reduce work I would like the "City" field in the address part of
the form to be automatically entered once a zip code is entered. I assume it
can get the data from the early table i created with just the cities and
zips on it, but I just figure out how to do it. Thanks in advance for any
assistance.

--
djm



Reply With Quote
  #2  
Old   
DD
 
Posts: n/a

Default Re: Zip Code and City - 11-08-2003 , 09:56 PM






Why not make a new query containing all the fields from both tables,
make a new form with all the relevant data
The following code will place all of the Customers details into the
fileds by just selecting the Customer via a combox, where the
CustomerId is the Customer Name
I hope it helps



In the [CustomerId] field on the form go to properites, AfterUpdate:
and write code.


Private Sub CustomerID_AfterUpdate()
On Error GoTo TrapAnError
' Update City controls based on value selected in CustomerID combo
box.
Me!Name = Me![CustomerID].Column(1)
Me!Address = Me!Address
Me!City = Me!City
Me!Region = Me!Region
Me!PostalCode = Me!PostalCode
Me!Country = Me!Country
Exit_CustomerID_AfterUpdate:
Exit Sub



"djm" <tezoza (AT) earthlink (DOT) net> wrote

Quote:
I have a table and a form with about 100 zip codes and their corresponding
cities. I have another table and form that will contain each person's full
address. To reduce work I would like the "City" field in the address part of
the form to be automatically entered once a zip code is entered. I assume it
can get the data from the early table i created with just the cities and
zips on it, but I just figure out how to do it. Thanks in advance for any
assistance.

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.