PDA

View Full Version : Form Help



Emoncada
05-03-2007, 10:57 AM
I have a form that I would like to add a drop down list. How can I attache a list for that drop down and have it work like an =Indirect for another dropdown. So the second dropdown would give you a list depending on what the first dropdown item points to.

Any Help would be great.

lucas
05-03-2007, 12:04 PM
This uses additem....?? Not sure if it's what your looking for...
Option Explicit
Private Sub cmbCountry_Change()

With Me
If .cmbCountry.Value = "KINGDOM OF SAUDI ARABIA" Then
With cmbRestaurant
.Clear
.AddItem "OLAYA"
.AddItem "DAREEN"
.AddItem "GERNATA"
End With
End If
End With

With Me
If .cmbCountry.Value = "UNITED ARAB EMIRATES" Then
With cmbRestaurant
.Clear
.AddItem "JUMEIRA"
.AddItem "CITY CENTER"
End With
End If
End With
End Sub

Private Sub UserForm_Initialize()
With Me
With cmbCountry
.AddItem "UNITED ARAB EMIRATES"
.AddItem "KINGDOM OF SAUDI ARABIA"
End With
End With

End Sub

Emoncada
05-03-2007, 12:37 PM
That Can work. I will try it thanks.

lucas
05-03-2007, 12:57 PM
Here's an example of the same thing using values from the sheet and offset values from the sheet for the second combobox