combobox not clearing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with 4 combo boxes and several text boxes.
All combos are filled in the form load event.
The first combobox contains names and this is the code to
fill it:

'istantitiate data tier object
mobjUnityGroup = New UnityGroupData

'get the list of names from the data tier
dvNames = mobjUnityGroup.getNames

With cboName
.DataSource = dvNames
.DisplayMember = "Name"
.ValueMember = "ChildID"
.SelectedIndex = -1
End With

All other combo boxes are filled at the same time and the same way (with
different datasource, display member, valuemember).

I select a name and in the selectedindexchanged event, the fields are filled
in and bound to the form. That works fine. However, after editing the
record and saving, by clicking the Save button on the form, I wish to clear
all fields, including the combo boxes. All combo boxes clear except the
cboName.

I another procedure I am setting all combo boxes' selectedindex = 0 and then
selectedindex = -1 per the bug. All works fine except for the name combo
box. I am getting an error "Object reference not set to an instance of the
object"

Anyone have any idea why this is happening?
 
Back
Top