473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Making access 2002 fill in the city from a zip code tbl

I am new to database apps, but I am making a db with access 2002. Here is
what I have and what I would like for it to do.

tblCustomers = holds customer info (Name, Address, City, State, Zip, Phone)
tblzips = holds ( Zip codes, City, State, County, Country)

tblzips

ID Zipcode City State County Country

I would like to have the Enduser type in the Zip in the customers table, and
it fill in the
City State County Country automaticly for the customer table.

How can this be done or can it??

Nov 13 '05 #1
9 1994

Mike McGee wrote:
I am new to database apps, but I am making a db with access 2002. Here is
what I have and what I would like for it to do.

tblCustomers = holds customer info (Name, Address, City, State, Zip, Phone)
tblzips = holds ( Zip codes, City, State, County, Country)

tblzips

ID Zipcode City State County Country

I would like to have the Enduser type in the Zip in the customers table, and
it fill in the
City State County Country automaticly for the customer table.

How can this be done or can it??


Can it be done?
Yes.

How can it be done?
Form datasheet view bound to tblCustomers with Zip AfterUpdate opening
recordset with query to tblZip

Should it be done?
That's the interesting question. You're actually denormalizing since
Zip gets you everything :-). I suppose it's good to verify that the
city is correct. Once the information is verified I don't see why you
need it in tblCustomers if tblzips is kept current.

James A. Fortune

Nov 13 '05 #2
I think I understand thanks for the help your right why have the same
information in 2 places.
seems I need to rethink a little bit. thanks again
Mike McGee
MBR Guaranteed Foundation Repairs

<ji********@compumarc.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...

Mike McGee wrote:
I am new to database apps, but I am making a db with access 2002. Here is what I have and what I would like for it to do.

tblCustomers = holds customer info (Name, Address, City, State, Zip, Phone) tblzips = holds ( Zip codes, City, State, County, Country)

tblzips

ID Zipcode City State County Country

I would like to have the Enduser type in the Zip in the customers table, and it fill in the
City State County Country automaticly for the customer table.

How can this be done or can it??


Can it be done?
Yes.

How can it be done?
Form datasheet view bound to tblCustomers with Zip AfterUpdate opening
recordset with query to tblZip

Should it be done?
That's the interesting question. You're actually denormalizing since
Zip gets you everything :-). I suppose it's good to verify that the
city is correct. Once the information is verified I don't see why you
need it in tblCustomers if tblzips is kept current.

James A. Fortune

Nov 13 '05 #3
"Mike McGee" <te*****@sbcglobal.net> wrote in
news:Ns***************@newssvr12.news.prodigy.com:
I am new to database apps, but I am making a db with access 2002.
Here is what I have and what I would like for it to do.

tblCustomers = holds customer info (Name, Address, City, State,
Zip, Phone) tblzips = holds ( Zip codes, City, State, County,
Country)

tblzips

ID Zipcode City State County Country

I would like to have the Enduser type in the Zip in the customers
table, and it fill in the
City State County Country automaticly for the customer
table.

How can this be done or can it??


I would do it with a combo box, and have the AfterUpdate of the
combo box populate the fields from columns of the combo box.

There are completely valid reasons to duplicate the data, rather
than using a lookup to the zip code table. One such is that there's
not always a 1:1 relationship between zip code and city name. That
is, the single city name stored with the zip code will always be
correct, but it won't necessarily be the only name that zip code is
referred to by.

Most people would say I live in Astoria, NY, in Queens, NYC. But the
Post Office defaults to Long Island City as the city name in their
lookup tables. But Astoria, Long Island City and Queens are all
valid for the city in sending snail mail to my address.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #4
Mike McGee wrote:
I think I understand thanks for the help your right why have the same
information in 2 places.
seems I need to rethink a little bit. thanks again
Mike McGee
MBR Guaranteed Foundation Repairs


You can do what I do - claim that having the info in two places will
make the queries have one less join. But that approach has burned me
in the past. I set up a database that had a tblJobs with about 100
fields. The fields belonged in that table except for three departments
with four fields of information each. A few years later, the company
liked the department information so much that they decided to get more
detailed information by having eight departments with eight fields
each. Plus backward compatibility to the old 12 fields got the table
to about 164 fields. They were pretty pressed for time so the quickest
way to implement it was to add the fields. They also liked to have
editable datasheet subforms despite my efforts to limit them. The
simpler queries allowed them to keep editing the subforms. So everyone
was happy. Recently, several of their customers have been demanding
capacity studies broken out by each department. But the new quotes
have 24 departments. I'm now forced to normalize so that all 24
departments can be tracked by hours quoted and timetickets. I had to
explain that the whole process is going to take much longer than
before. I explained that they won't be able to edit some subforms
because the extra join makes some queries too complex. Plus, the slow
transition requires that I leave all the old fields in for backward
compatibility so that all the reports will work until new ones are
made. Not to mention the backward compatibility of the backward
compatibility (they like being able to go back pretty far). So if I
seem to be harping on normalization it's because I just went through a
painful lesson. I still don't like normalization to the nth degree but
my tradeoff point is fluxing towards more normalization. On top of all
that, one secretary is on a crusade to have ever larger forms where any
and all information is obtainable. Think in the neighborhood of
hundreds of fields on the main forms. It seems that prevailing office
practices denormalize databases and work toward degrading performance.
I've tried explaining how it works to them but they prefer convenience
to speed.

James A. Fortune

Nov 13 '05 #5
On 12 Jul 2005 10:35:34 -0700, ji********@compumarc.com wrote:

Zip doesn't get you everything. At least in the USA there is a 1:M
between Zip and City. There also is a 1:M between City and State.
-Tom.

Mike McGee wrote:
I am new to database apps, but I am making a db with access 2002. Here is
what I have and what I would like for it to do.

tblCustomers = holds customer info (Name, Address, City, State, Zip, Phone)
tblzips = holds ( Zip codes, City, State, County, Country)

tblzips

ID Zipcode City State County Country

I would like to have the Enduser type in the Zip in the customers table, and
it fill in the
City State County Country automaticly for the customer table.

How can this be done or can it??


Can it be done?
Yes.

How can it be done?
Form datasheet view bound to tblCustomers with Zip AfterUpdate opening
recordset with query to tblZip

Should it be done?
That's the interesting question. You're actually denormalizing since
Zip gets you everything :-). I suppose it's good to verify that the
city is correct. Once the information is verified I don't see why you
need it in tblCustomers if tblzips is kept current.

James A. Fortune


Nov 13 '05 #6
Tom van Stiphout wrote:
On 12 Jul 2005 10:35:34 -0700, ji********@compumarc.com wrote:

Zip doesn't get you everything. At least in the USA there is a 1:M
between Zip and City. There also is a 1:M between City and State.
-Tom.


That's interesting. I didn't know there was a 1:M between Zip and
City. It seems a little counterintuitive but if it's so, you have to
deal with it if you have any like that in the database. It makes sense
that a zip code can handle multiple cities. A 1:M between City and
State is O.K. as long as there's no 1:M between Zip and State. Since
the improbable is likely :-) he's better off with human input I guess,
or at least editing out the other cities that show up for that zip
code.

James A. Fortune

Nov 13 '05 #7
On Tue, 12 Jul 2005 22:19:58 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:
"Mike McGee" <te*****@sbcglobal.net> wrote in
news:Ns***************@newssvr12.news.prodigy.com :
I am new to database apps, but I am making a db with access 2002.
Here is what I have and what I would like for it to do.

tblCustomers = holds customer info (Name, Address, City, State,
Zip, Phone) tblzips = holds ( Zip codes, City, State, County,
Country)

tblzips

ID Zipcode City State County Country

I would like to have the Enduser type in the Zip in the customers
table, and it fill in the
City State County Country automaticly for the customer
table.

How can this be done or can it??


I would do it with a combo box, and have the AfterUpdate of the
combo box populate the fields from columns of the combo box.

There are completely valid reasons to duplicate the data, rather
than using a lookup to the zip code table. One such is that there's
not always a 1:1 relationship between zip code and city name. That
is, the single city name stored with the zip code will always be
correct, but it won't necessarily be the only name that zip code is
referred to by.

Most people would say I live in Astoria, NY, in Queens, NYC. But the
Post Office defaults to Long Island City as the city name in their
lookup tables. But Astoria, Long Island City and Queens are all
valid for the city in sending snail mail to my address.

If you use the 5+4 zip code does that limit the mail to only Astoria?

There are three small towns in VA that share one post office. The first 5
digits gets to the post office. The next 4 digits determines the mail carier
route.

Chuck

Nov 13 '05 #8

David W. Fenton wrote:
...
I would do it with a combo box, and have the AfterUpdate of the
combo box populate the fields from columns of the combo box.


I agree. I have done it this way for Access and for ASP. Bringing in
several fields at once and using the combobox/custom control as a local
repository saves having to retrieve the information from the table
after the zipcode (custcode in my case) is chosen.

James A. Fortune

Nov 13 '05 #9
Chuck <li*****@schoollink.net> wrote in
news:j8********************************@4ax.com:
On Tue, 12 Jul 2005 22:19:58 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:
"Mike McGee" <te*****@sbcglobal.net> wrote in
news:Ns***************@newssvr12.news.prodigy.co m:
I am new to database apps, but I am making a db with access
2002. Here is what I have and what I would like for it to do.

tblCustomers = holds customer info (Name, Address, City, State,
Zip, Phone) tblzips = holds ( Zip codes, City, State, County,
Country)

tblzips

ID Zipcode City State County Country

I would like to have the Enduser type in the Zip in the
customers table, and it fill in the
City State County Country automaticly for the
customer table.

How can this be done or can it??
I would do it with a combo box, and have the AfterUpdate of the
combo box populate the fields from columns of the combo box.

There are completely valid reasons to duplicate the data, rather
than using a lookup to the zip code table. One such is that
there's not always a 1:1 relationship between zip code and city
name. That is, the single city name stored with the zip code will
always be correct, but it won't necessarily be the only name that
zip code is referred to by.

Most people would say I live in Astoria, NY, in Queens, NYC. But
the Post Office defaults to Long Island City as the city name in
their lookup tables. But Astoria, Long Island City and Queens are
all valid for the city in sending snail mail to my address.


If you use the 5+4 zip code does that limit the mail to only
Astoria?


Well, that I don't know. It depends on your lookup table.

My post office is called "Long Island City" but much of the coverage
area of the 5-digit zip for it is Astoria. And both are sub-sections
of Queens, which is also valid.
There are three small towns in VA that share one post office. The
first 5 digits gets to the post office. The next 4 digits
determines the mail carier route.


I am certain that there are many mail carriers working out of my
local post office. Some may even have routes that are partly in
Astoria and partly in Long Island City.

Of course, there are no hard and fast borders between the two --
human beings may make different determinations of where the boundary
lies, and the zip code system allows for this by having a
non-exclusive relationship running from 5-digit zip to city.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Fabio Papa | last post by:
Hi, I am fairly new to programming and and even newer to dotnet. I appoligise in advance if this is a dumb questions, and I would appreciate if you could answer it anyways. :) I am writing a...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
1
by: Kristof | last post by:
Hello, I have a question about relations. I have a table with city's and zipcodes. I need to insert these in an other table when filling in a form. So far all works fine. But now i want it to...
5
by: j.mandala | last post by:
Someone is trying to run my Access 2002 database under Access 2003. He has had a number of problems: 1) i used the MSComCt2.ocx for it's Date and Time picker. I can't find it under 2003. Do I...
5
by: ND | last post by:
I need to create a separate field from 4 fields, "street address", "city", "State" and "zip code". For example, Street address - 100 Forest Street City - Seattle State - WA Zip - 05555 ...
1
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
6
by: JeffB | last post by:
I have tried several different methods of getting a datagrid to fill with information. Below is the code I'm now using. When viewed in the browser and the text box filled with a parameter value...
2
by: SKarnis | last post by:
We are trying to rebuild a current Access 2002 (XP) mdb program to VB.NET with a SQL database - we are having problems with a suitable combobox. There are many threads discussing multiple column...
6
by: ET | last post by:
Dear All, I have once made a mdb file using access 2000 under Windows 2000. I didn't use it for long. Today I tried but some codes just didn't work. I am using Access 2002 and Windows XP. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.