Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Entries in Access Db

Status
Not open for further replies.

sysadmin07

IS-IT--Management
Feb 20, 2007
41
US
Hello,

I have a CF page with textboxes that populate an Access database. In two of the textboxes, I have a user enter their city and zip. In some cases, a city will cover more than one zip and I'd like to give them the capability to account for this. For example, if "Los Angeles" is entered, and they live near 90001 and 90002, is it possible to have these zips entered into the db automatically. Example of how I'd like it to look in the db:

City Zip Code
Los Angeles-1 90001
Los Angeles-2 90002

Thanks in advance!
 
The only way you're going to be able to do this is to provide multiple textboxes for your users, which isn;t a nice way of doing it, or use a zip code lookup system, that will allow you to send a "query" to their service. in my experience these systems cost money to use.

Being based in the UK i can;t really offer much experience of looking up US addresses, but i use a system from postcode anywhere ( to achieve this functionality, and they do have a US lookup service.

Hope this helps!

Tony
 
Thanks for the help. I'm planning on using the multiple textbox "route," but I'm unsure how to insert multiple values into a table at once. For example, if I have the user enter "Los Angeles" as the city and "90001" and "90002" as their zips, how would I go about doing that? Also, is it possible to append a -1 or -2 onto each city entry, so that there isn't a primary key conflict, as illustrated below?

City Zip Code
Los Angeles-1 90001
Los Angeles-2 90002
 
In your data example, the primary key should be a combination of the user, the city, and the ZIP code. It's not possible to nominate the city field alone as a primary key. And it doesn't make sense to append a number to a city name.

Also, how many textboxes are you coding for? What if a user needs more textboxes than you have?

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the insomniac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Thank you for your reply. The users will be limited to 3 zip code entries for now. The city field isn't the primary key, I have an autonumber set for that. As for the appending of a number to the city, it is used within various loops that are used to generate a map and I'd like maintain that (I'm doing it manually, currently).

I appreciate it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top