simply, if the combobox has either listindex 1, 5, 7 or 10 selected then it does an action. can someone show me how to do so?
vb Code: Option Explicit Private Sub Combo1_Click() Select Case Combo1.ListIndex 'Note: ListIndex starts at 0! 'So first item in list will have ListIndex of 0, 2nd, 1, etc. Case 1, 5, 7, 10 DoSomething End Select End Sub Private Sub DoSomething() MsgBox "Um, what do you want me to do?", vbQuestion, "You told me to do something?" End Sub Private Sub Form_Load() 'Load some items. Dim i As Integer For i = 1 To 11 Combo1.AddItem CStr(i) Next i End Sub
Option Explicit Private Sub Combo1_Click() Select Case Combo1.ListIndex 'Note: ListIndex starts at 0! 'So first item in list will have ListIndex of 0, 2nd, 1, etc. Case 1, 5, 7, 10 DoSomething End Select End Sub Private Sub DoSomething() MsgBox "Um, what do you want me to do?", vbQuestion, "You told me to do something?" End Sub Private Sub Form_Load() 'Load some items. Dim i As Integer For i = 1 To 11 Combo1.AddItem CStr(i) Next i End Sub
and there it is lol, thank you
Forum Rules