Cricket
Active member
I've written a sub that refreshes the contents of a ComboBox when you select an item from another ComboBox.
It kinda works perfect, every second time however it doesn't work! This makes no sense since it calls the exact same sub. Now here is the strange part. If I comment out the Clear method it will Fill the other ComboBox as expected, however it will have double the items due to not clearing it first. This means the refesh is working, but the Clear method is somehow getting called after the Fill method.
Has anyone seen this? Is my code doing something that I'm unaware of?
PrivateSub cboSeries_SelectedValueChanged(ByVal sender AsObject, ByVal e As System.EventArgs) Handles cboSeries.SelectedValueChanged
Me.ocSelectSeriesModel.Parameters("@fuid_Series").Value = Me.cboSeries.SelectedValue
Me.daProposal.SelectCommand = Me.ocSelectSeriesModel
Me.dtSeriesModel.Clear()
Me.daProposal.Fill(Me.dtSeriesModel)
EndSub
It kinda works perfect, every second time however it doesn't work! This makes no sense since it calls the exact same sub. Now here is the strange part. If I comment out the Clear method it will Fill the other ComboBox as expected, however it will have double the items due to not clearing it first. This means the refesh is working, but the Clear method is somehow getting called after the Fill method.
Has anyone seen this? Is my code doing something that I'm unaware of?
PrivateSub cboSeries_SelectedValueChanged(ByVal sender AsObject, ByVal e As System.EventArgs) Handles cboSeries.SelectedValueChanged
Me.ocSelectSeriesModel.Parameters("@fuid_Series").Value = Me.cboSeries.SelectedValue
Me.daProposal.SelectCommand = Me.ocSelectSeriesModel
Me.dtSeriesModel.Clear()
Me.daProposal.Fill(Me.dtSeriesModel)
EndSub
Last edited: