Default combo box with the value in another combo box

CSCS

Registered User.
Local time
Today, 09:08
Joined
Jan 10, 2004
Messages
91
Hi,

In my form I have 2 combo boxes. one for Nationality, and the other is for PlaceOfBirth.

I want the PlaceOfBirth to be defaulted with whatever nationality the user choose.

How can I do that?

any help is very appreciated.

Thanks,
CS.
 
search for "cascading combo boxes". there might be something in the sample db's.
 
I did.

the results I got on how to control the values of one combo box depending on the value choose in another combo box.

in my case the values are not changing, I just want to default one combo box depending on the value used in another combo box
 
how do you know which value to default to? is there only one choice in the second combo?
 
No.

both combo boxes (Nationality, PlaceOfBirth) have the same values (which is country names).

What I want is:

when in Nationality the user choose a country (for example USA) in the PlaceOfBirth USA will appear, which the user can change if the employee was not born in USA. its just a way to facilitate the use of the application as most people are born in the same place as their nationality.

Help!
 
i did it like this:

tblPerson
---------
Name
etc...
CountryID_Nationality
CountryID_CountryOfBirth

tblCountry
----------
CountryID
Country
Nationality

two queries, both based on tblCountry:
--------------------------------------
1. qryNationalities: fields: CountryID, Nationality (ASC)
2. qryCountries: fields: CountryID, Country (ASC)


the form (based on Person):
---------------------------
- turn the two fields, CountryID_Nationality and CountryID_CountryOfBirth into combo boxes: cboNationality and cboCountryOfBirth
- apply the first query to the first cbo and the second to the second.

VBA
----
- in the after update event of the first combo:
Code:
Private Sub cboNationality_AfterUpdate()
    Me.cboCountryOfBirth = Me.cboNationality
End Sub
 

Users who are viewing this thread

Back
Top Bottom