Populate 2nd combo box based on value selected in first combo box?

C

cdc01

I have 3 combo boxes. The first one is static inputs, the second need
to be populated with inputs (via .AddItem) based on which input th
user selects from combobox one. The third needs to be populated (vi
.AddItem) based on what the user selects for the input in combobox 2.
Is this possible?? Thanks...

Chad!

BTW..this form runs, but cmbFile is only populated with ".bsn"

Private Sub UserForm_Initialize()
'populate the 1st combo box - this is static info
With cmbParam
.AddItem "Flow"
.AddItem "Sediment"
.AddItem "Phosphorous"
.AddItem "Nitrate"
End With
'now i need to populate the second box based on which input value wa
selected above
'this if statement below doesnt work, but it illustrates what i want t
do
'if statement for population of 2nd combo box
If cmbParam = "Flow" Then
With cmbFile
.AddItem ".bsn"
.AddItem ".gw"
.AddItem ".hru"
.AddItem ".mgt1"
End With
ElseIf cmbParam = "Sediment" Then
With cmbFile
.AddItem ".bsn"
.AddItem ".hru"
.AddItem ".mgt1"
.AddItem ".rte"
End With
ElseIf cmbParam = "Phosphorous" Then
With cmbFile
.AddItem ".bsn"
.AddItem ".mgt2"
.AddItem ".sol"
.AddItem ".swq"
.AddItem ".wwq"
End With
Else: cmbParam = "Nitrate"
With cmbFile
.AddItem ".bsn"
End With
End If
'next i need to populate the final combo box based on what input valu
was selected in the 2nd box
'below are the values for the 3rd box
With cmbVar
.AddItem "GWQMN"
.AddItem "REVAPMN"
.AddItem "GW_REVAP"
.AddItem "CN1"
.AddItem "ESCO"
.AddItem "USLE_K1"
.AddItem "SLOPE"
.AddItem "CH_N2"
.AddItem "SLSUBBSN"
.AddItem "APM"
.AddItem "PRF"
.AddItem "SPCON"
.AddItem "SPEXP"
.AddItem "USLE_P"
End With
End Su
 
B

Bob Phillips

Of course it is. Give me your email address and I will mail you an example
workbook.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Top