Combobox Country, State, City

Feb 21, 2007

Hi All!!

I need help with the code for a combobox. The thing is that I've created a form where the user has to select the country, then the state and finally the city. What I need is that once the user selects the country, the combobox of the state shows only the states of that country and then the combobox of the city shows only the cities of the chosen state. I'd appreciate all the help given. Andrew.

View Replies


ADVERTISEMENT

Country / City Combo Box

Jul 11, 2007

Hi
My name is Dana and this is my first post here .
I am a DB newbie , i started to teach my self MS Access with a small project as a start .
I made a simple client data table where there are country and city fields + phone , fax , etc etc ... .
I made 2 tables 1 for the countries and 1 for the cities .
I know that it is a very familiar question :o
How can we do the following
when you select a country in the client table , only cities of this country show up in the city combo box .
I found some answers here and there , but as a newbie , the codes where difficult to understand .
I attached my source file and i will be thankful if someone could help and to give me a simple explanation of the codes concept .
I just want to add the codes in the table not in a form , i found some answers by adding codes to a Form :confused: . Because as i know i can export only tables and queries to sql.

View 7 Replies View Related

City State Zip??

Aug 26, 2005

Does any one know of a place online where you can get the tables (for free I hope) for a city state zip comboboxes, or at least the tables for all cities in the US.

View 8 Replies View Related

Autopopulate City & State From Zipcode Table

Mar 1, 2005

I'm stuck on something that should be simple, but maybe it isn't:

Problem 1:

To speed data entry in a contact table, I want an entry in the Zipcode (postal code) field to automatically populate the City and State fields from the data in a Zipcode table (Zipcode-PK, City, ST (2 letter code)). The Zipcode table has only one city /st for each zipcode, so it can be the primary key (always a five digit number, sometimes with leading zero(s)).

Sometimes there are several names for a City associated with a particular Zipcode, so I want the City field to be able to be overwritten with a different city name if the data entry person needs to do that. Alternatively, I could establish a separate primary key for the zipcode table, and allow several choices for the rare zipcode that has more than one city name in use.

If I did that I wouldn't have to store the city and st in the contact table (which is better database design, I realize), but I really do want to be able to store the city and state in the contact table because there will be times when the right zipcode isn't known, and the city and state are known, and forcing the input of a possibly incorrect zipcode would be undesirable.

Problem 2: I've got a table with 4,000 records where I have the zipcode, but the city and state information were lost, and I want to be able to re-populate those fields by writing, I guess, an update query that taps the info in the zipcode table.

Problem 3: When entering addresses, sometimes there won't be info about a certain zipcode, and I need some automatically generated dialog that allows adding city and state info for a new zipcode that won't slow down the entry of contact records.

Any help would be greatly appreciated. Thanks in advance. Send an email if you prefer.

HenryTD

View 3 Replies View Related

Count City

Aug 23, 2006

I have a problem with counting the people in each city. I will give a discription of my tables first and than explain what I want.

City
ID
City
LocationID

People
ID
Name
BirthPlace
DeadPlace
...

What I want is a list of all the cities in LocationID = 1 and a count of all the people that where born there.

Example:
Bazel 12
Belsele 47
Beveren 170
Burcht 1
Daknam 0
De Klinge 9
Doel 1
Eksaarde 6
Elversele 3
Haasdonk 46
Kallo 1
Kemzeke 5
Kieldrecht 5
Kruibeke 13
Lokeren 10
Meerdonk 2
Melsele 13
Moerbeke 12
Nieuwkerken 35
Rupelmonde 2
Sinaai 49
Sint-Gillis 23
Sint-Niklaas 106
Sint-Pauwels 33
Steendorp 3
Stekene 45
Temse 16
Tielrode 3
Vrasene 5
Waasmunster 21
Zwijndrecht 10

My problem is that there are always a few cities missing and I can't seem to get my SQL correct.

Thanks

View 3 Replies View Related

Using Country Field To Determine VAT Rate.

May 9, 2007

hey,

i have a customer form which includes a "Country" combo box.. the reason i did this is because i have a separate table with a list of countries and their VAT (Value Added Tax, you americans call it sales tax i think :)) rates.

i want this country saved in the customers table.. i need the country table to act merely as a source of data. Now ive spent a good hour tying to fix it messing around with the relationship between the two tables and the combo box itself.. but ive only been able to come to two end results

a) access tells me i cant save the new customer record cause a related record is required in the country table.

b) access enters a new line in my country table with the autonumber of the country selected on the add new customer form in the Country field.

im stumped as to where the problem is:// how can i fix it?

View 5 Replies View Related

General :: Country Drop-down List?

Dec 13, 2012

I have a form (Create Guest). Employees can add guests and fill in the details. There is a label Country that Employees can fill in manually.

The problem now is that this is very fault sensitive (people type: "The Netherlands", "Holland" or "Netherlands" for example while this is one country).

How do I create a country drop-down list so that employees won't have to type the country in manually. I don't think adding all the countries in the world in my table is a good solution.

View 10 Replies View Related

Forms :: Selecting A Specific Country Its Cities Should Appear

May 1, 2013

i have created tables as provinces, districts and sub-districts in my other forms say member i have create a look up wizard to the provinces, districts and sub districts. every province has multiple cities and every districts has multiple sub-districts my question is how to set properties so that if i select a specific province all its districts should appear in district field and districts of other provinces should be filtered. a good example is on some websites when we select a specific country all its cities or states appear in city field and if we change our option to some other country city drop box also changes to the cities of that respective country...

View 2 Replies View Related

Find A City In The Middle Of A Field

Jan 11, 2008

Ok Im having trouble with this, I need to remove cities from an address field but don't know a simple query that does this. Can any body help

heres an example

Address1 City
10/F, HONG KONG LAI CHI KOK EXCHANGE IIHONG KONG

Now I want to be able to pull Hong kong out of the address1 field but without searching in the address field with *HONG KONG* as this would involve checking every city in a table.

Please help!

View 1 Replies View Related

Create A Country Info Database With Display Field

Apr 30, 2013

I want to create a country info database. For example, Qatar (country) and the Driving info required when driving in qatar and the visa info required.

I would like a form with drop down options and when i selected which country and then driving or visa, at the bottom it would display the specific info based on my selection in a memo field lets say.

View 1 Replies View Related

Queries :: Start And Finish Distance Within City - XLS

Mar 8, 2015

I use Access 2003 and want to make a query by specifying the start and finish within the city, I send files. a

Attached file ...

View 1 Replies View Related

Forms :: Asset Tracking When Items With Unique ID Transferred From One City To Another

Aug 6, 2014

I have a task of managing hardware assets like desktop, monitor, HDD, routers etc. Each item is marked with a unique ID.

These items could be transferred from one city to another city; so need to track that too.

1. There will be two tables

One (say AssetDetail) will have the following fields
RecordID
City
AssetID
Description of the asset (desktop/monitor etc)
ProductSerialNumber of the asset

Second (say AssetTransfer) will have the additional fields
NewCity
AssetTransferredDate

2. I only want to open a single form :

a) where on the basis of either AssetID or the ProductSerialNumber, I could open a particular record and edit it.

i) if the asset is transferred from city A to city B; then the "City" field value in AssetDetail table should change to "city B"(New City field value).

ii) At the same time, each asset transfer record should get appended to the AssetTransfer table even if the table has an existing record with the same AssetID or ProductSerialNumber.

3. Also need an option to make a new entry to the AssetDetail table from the above mentioned single form.

View 4 Replies View Related

Unexpected State

Jul 13, 2005

Ok, I know you guys have heard about this problem quiet a few times, my search told me that. But my problem has a bit of a twist. The message appeared when I tried to open the database yesterday, so I went to the backups and tried to open them. All the backups for the past month give the same message. The problem is with the FE only, the BE is working fine. The backups are connected to the same workgroup as the FE and BE. Has anyone seen this before and know what might of happened?

View 8 Replies View Related

Determine State

Mar 28, 2006

I am trying to determine the state that a job is located in. If the ProjectID begins with a 2 then it is in California. If it does not then the job is located in Nevada.

State: IIf(Left([tblMainFrontierUnits].[ProjectID],1)="2","CA","NV")

What is wrong with this statement? I am getting a compile error.

View 5 Replies View Related

Check Box State

Dec 9, 2005

If the check box is null (grey) - the default value, I do not want to include it is the sql statement. If I use the code below I get the error 94 Invalid use of null. How else can I exclude this ststement is the check box is grey.

thanks

If CheckStaged Then
strWHERE = strWHERE & " AND s.Staged = " & CheckStaged
End If

View 2 Replies View Related

How Can The Value State The Date?

Dec 11, 2005

i have 2 questions.

1) how can i have a record automaticly fill in the next date from the privous record? (Example if record 1 has date:10/14/05 i want record 2 to fill in in that same feild 10/15/05?

2) how can i have a reccord automaticly fill in the same number from the privios record? (Example if record 1 has Number :34 i want record 2 to fill in in that same feild 35?


I keep on changing these numbers, so its vitel that it repeats the privous record

David

View 3 Replies View Related

Database Won't Open, Placed In A State.

Jun 7, 2006

I am getting the following Error:

"This database is in an unexpected state; Microsoft access cannot open it.

"This database has been converted from a prior version of Microsoft access by using the DAO CompactDatabase method instead of the Convert Database command on the tools menu. This has left the database in a partially converted state.

"If you have a copy of the database in its original format, use the convert database command on the tools menu to convert it. If the original database is no longer available, create a new database and import your tables and queries to preserve your data. Your other database objects can't be recovered."

The database is on the server. Nothing was changed. Someone in our IT department says they simply opened it and then closed it. I think that they had their access program set to compact and repair on close.

I have tried to import the tables but am gettting the same errors.

I have the original database but it is an old backup that is missing data.

Can someone HELP

View 1 Replies View Related

Abbreviating State Names

Jan 14, 2005

Hello out there:
We have a application that imports information from a csv file into our customer order table. After we process the order we have to export this inforrmation to our UPS shipping program to process the shipments.

Problem is that the UPS program only recognizes the abbreviations for state names. Is there a way to run a macro, code or update query that will change the state names to the correct abbreviated version before we do our export?

Thanks immensely,
Ivan

View 2 Replies View Related

Queries :: Get Top 10 NPI Per State And County

Feb 27, 2015

I am trying to get the Top 10 NPI's by State and By County based on the Current_Year_Members_Outreached. Below is the query I created but I haven't been able to verify if the results are correct because when I execute it runs and some results show but in the lower right corner of the screen it says "Formatting Page" and seems to be taking forever.

My source table only has 67k records which doesn't seem like a lot. So, I have two questions:

1. Does my query below look correct based on what I am trying to achieve?
2. Is there a better way to right this query to get better performance?

Code:

SELECT
A.STATE,
A.COUNTY,
A.NPI,
A.[SumOfCurrent Year Members Outreached]
FROM Qry_Provider_Distinct AS A

[Code] ....

View 7 Replies View Related

Table With Country, ShipCountry, BillToCountry Linked To One Coutries Table

Nov 13, 2007

I would like suggestions on how to "properly" set up the tables and relationships required to do the following.
We have a customers table that can contain a Country, ShipCountry, and BillToCountry. All 3 countries could in theory be different. I want all 3 to store the CountryID from the Country lookup. I am trying top avoid a circular reference or any data contention issues. What is the proper method to do this?
Thanks very much in advance!

View 4 Replies View Related

Countries,state/province,region

Mar 3, 2007

Do you know of any knows list that contains cross-refs of all Countries,state/province,region so that I can build cascading combox for my site.

This is very strange. It is a concept we see all over the internet websites, but the least documented!!!!

View 1 Replies View Related

Access Data To Display On State Map

Jan 15, 2013

I have a database will all the FM stations in the USA/Canada, I wish to plot the frequency and calls to the correct city on the state map as per the attachment, can it be done? If so, what are my steps and what maps can I use?

View 2 Replies View Related

Setting Checkboxes Back To A Cleared State

Jul 13, 2005

Apologies first if there is an easy answer to my problem.

I have set up an option group with 3 checkboxes with choices Yes, No, Maybe. On data entry you can click any of the three boxes but after clicking one how do you revert to a situation with all 3 checkboxes cleared.
I don't want to use a default checkbox as that would add another row but I just want to clear out the boxes so it looks as though none of them have been ticked.

I hope somebody understands my problem.

View 2 Replies View Related

Expression To State Current Balance After Each Transaction

Aug 24, 2004


I am trying to create a suitable expression, either on the form itself or in the underlying query, that calculate the balance after each transaction, like a bank statement. What is the best way to do it?

Paul

View 2 Replies View Related

General :: State Of A Record Where Changes Made But Not Saved

Dec 8, 2012

i want to have a button where the operator can cancel when on a current record. i want an if. if form has changes made but not saved then undo else close.

is the record state 'dirty'?

View 2 Replies View Related

Modules & VBA :: How To Execute A DoCmd From Within A Connection State

Feb 24, 2014

I'm trying to do something with Excel and Access. From Excel 2007, I need to open an Access database exclusive, import from Access to Excel a table, do some work within Excel, and then start a macro within the Access database. Briefly, here’s what I have

1) To open the database exclusively:

Set connDB = New ADODB.Connection
With connDB
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Mode = adModeShareExclusive
.Open strdbpath 'path to database
End With

2) To import from Access:

strSQL = "SELECT * FROM [" & tn & "];" 'tn is Access table
If connDB.State = adStateOpen Then
Set objRS = New ADODB.Recordset
objRS.Open strSQL, connDB, adOpenForwardOnly
On Error Resume Next
objRS.MoveFirst
If Err.Number = 0 Then
On Error GoTo 0
fieldCnt = objRS.Fields.Count
For fieldNum = 0 To fieldCnt - 1
ws.Cells(1, fieldNum + 1).Value = objRS.Fie(fieldNum).Name
Next fieldNum
ws.Cells(2, 1).CopyFromRecordset objRS
End If
End If

3) To start a macro:

DoCmd.RunMacro "Daily Import"

Everything seems to work until the ‘DoCmd’ statement where I get a “You can’t carry out this action at the present time” error message.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved