Trouble Clearing Combo Boxes

Gus_19

New member
Joined
Apr 4, 2012
Messages
2
Programming Experience
Beginner
As for the form, the user enters the data, but if they need to add additional items (i.e. more people, property vehicles), I need the data to save to an excel file, but clear the form. I have been able to get the textboxes and rich textboxes to clear, but I am unsure how to have combo boxes clear out (go blank). Here is a snippet of what I've written for the text and rich textboxes. Intellisense won't let me select selectindex and I'm currently stuck.

For Each Me.cControl In Person.Controls
If (TypeOf cControl Is TextBox) Then
cControl.Text = ""
End If
If (TypeOf cControl Is RichTextBox) Then
cControl.Text = ""
End If
Next cControl
 
To get the selection in a ComboBox, what do you do? You get the SelectedIndex or SelectedItem, right? What value do those properties have if there is no selection? There's your answer.
 
Back
Top