GRRRR... I've run across a situation in which I have NO solution. Hopefully
there is one. VB.net.
It's rather simple.
I've a ComboBox that get's populated via a Database. And I pre-select (during
Formload) the Index using SelectedIndex:
' Get User info from Data Base fill
daPickUser.Fill (dsPickUser.MAS TER_PRM_EMPLOYE E)
cmbUserName.Sel ectedIndex = cmbUserName.Fin dStringExact(st rUserID)
Now the above works just fine. It finds my strUserID (ie: FEU001 which is
Index #28) and that is what is listed in the ComboBox on startup. Great!
However, I want to use the Combobox to select another User at some time. When
I ENABLE the following Private Sub for the Combobox, I get my troubles...
My Combobox even is thus...
Private Sub cmbUserName_Sel ectedIndexChang ed(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles cmbUserName.Sel ectedIndexChang ed
dsTimberline.tb lTimeEntry.Clea r()
' Refresh the Data Grid with New User Selected
strUserID = cmbUserName.Tex t
daTimberline.Se lectCommand.Par ameters(0).Valu e = strUserID
daTimberline.Fi ll(dsTimberline .tblTimeEntry)
End Sub
What happens is that on startup, somehow the Combobox SelectedIndexCh anged
sets my Combobox Index to Zero (0)... every time. I don't want Index of 0.
But the listing of what is the Index number of my strUserID.
How can I prevent the cmbUserName_Sel ectedIndexChang ed from being triggered
during startup???
Regards,
Bruce