Fundamental question, I know. But I cannot find what I expect is a very simple answer.
I load the form in my combobox from an excel spreadsheet with no problem. And I populate my other textboxes when the user SELECTS from that list.
Code:
Private Sub ComboBoxNames_Change()
sheetRow = ComboBoxNames.ListIndex + 2
' listIndex is base 0; first data in sheet is row 2
With Sheets(sheetName)
TextBoxName.Text = .Cells(sheetRow, 1).Value
TextBoxAddress.Text = .Cells(sheetRow, 2).Value
TextBoxCity.Text = .Cells(sheetRow, 3).Value
If .Cells(sheetRow, 4).Value = isActive Then
OptionButtonActive.Enabled = True
Else
OptionButtonInactive.Enabled = True
End If
End With
CommandButtonAction.Caption = updateAction
CommandButtonAction.Enabled = True
End Sub
I know that the ComboBoxNames.Listindex is 0 if I type something not in the list, but that doesn't help. I've tried substituting
Code:
ComboBoxNames_Exit() ...
but that doesn't populate my TextBoxes.