Hey, this should be baby stuff, but I'm missing something. If I type a value into a combobox, have the code select a value and I then check the listindex, it's -1 instead of the selected value's index:Command1 keeps returning -1. If you type a value into the combo, it picks the 2nd item, but outside of that combobox, nothing recognizes this.Code:Private Sub Form_Load() With Combo1 .AddItem "1" .AddItem "2" .AddItem "3" .AddItem "4" End With Private Sub Combo1_Change() 'fired when typing - not click 'the value's not actually hard-coded 'it selects the index if the typed value matches one of the list entries 'but this simple hard-coding is done for example b/c it doesn't work either Combo1.ListIndex = 3 End Sub Private Sub Command1_Click() MsgBox Combo1.ListIndex 'keeps returning -1 End Sub
Thanks!




Reply With Quote