Dependant combo boxes

H

harpscardiff

Hi,

I've got a form with frames, text boxes, multipages and drop downs.
On one of the mulitpages, (page 1), I have two combo boxes, combo1 and
combo2.

Combo1 has main catergories:
Hardware
Software

I want combo2 to have results based on which option is selected from
combo1.

Combo2 if hardware:
PC
Monitor
Keyboard
Mouse
Telephone
Printer

Combo2 if software:
Word
Excel
power point
outlook

[ F O N T = \ " A r i a l B l a c k \ " ] A n y c h a n c e t h
i s c a n b e d o n e ? [ / F O N T ]

I've tried for hardware:


Code:
--------------------
Private Sub txtsubcat_AfterUpdate()
If combo1.Value = "PC" Then
With txtsubcat
.AddItem ("PC Base Unit")
.AddItem ("Monitor")
.AddItem ("Keyboard")
.AddItem ("Mouse")
End With

End If
End Sub
 
G

Guest

Create named ranges named "Hardware" and "Software" and then modify sample
code below:

Private Sub ComboBox1_Change()
ComboBox2.RowSource = ComboBox1.Value
End Sub

Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "Hardware"
.AddItem "Software"
End With
End Sub


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Scrabble Value calculation for Welsh words 0
Fill array with Values 4
excel 97: linking 2 combo boxes 1
dependant combo boxes 4
Incrementing IPv6 address 1
Cascading combo box 4
Combo box change 1
Group 1

Top