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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a combo box using another combo box based on values

Status
Not open for further replies.

OC2

IS-IT--Management
Apr 2, 2001
59
SG
hi, I have 2 combo boxes one has company names and the other has the section the company is under. These values are not based on a table or query. They are merely for an easy update table. in other words, instead of typing the company name and the section theyre under, i can select the company and that will automatically select the right section. Then when i add the record that info will be stored respectively.

My question is how do i select the company which then limits the selection from another combo box to only display the sections that company is responsible for?

Ive read RickDs Faq, but that is based on a table or query so is not related to my question

Any help is apprieciated

Thx

Regards

Tom
 
If you do not wish to store these values in a table then you will have to hard code your combo boxes. For example, if your first combo box had categories such as

Animals
Cars
Colors

You would have to put an "If...Then" or "Select Case" statement in the After Update event of the first combo box like so...

***** If....Then *****

If ComboBox1 = "Animals" Then
ComboBox2.RowSource = "Cat;Dog;Bird"
End If

If ComboBox1 = "Cars" Then
ComboBox2.RowSource = "Buick;Chevy;Ford"
End If

***** Select Case *****

Select Case ComboBox1

Case Is = "Animals"
ComboBox2.RowSource = "Cat;Dog;Bird"
Case Is = "Cars"
ComboBox2.RowSource = "Buick;Chevy;Ford"
End Select

ComboBox2 must have it's RowSourceType set at Value List.

Hope this helps... B-)
ljprodev@yahoo.com
ProDev
MS Access Applications
 
thx your message did nothing but help :)
That was exactly what I was looking for

best Regards

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top