I have two combobox in a form: Cb1 and Cb2
When I load the form, Cb1 and Cb2 are connected to a bindingsource.
When I change Cb1, the code (below) changes Cb2 to show only the items according to Cb1
This is working fine.
The problem is when I change Cb1 , change Cb2 and click the save button..... Cb2 seems to be 'lost'...

I'm using VS2008.

Thanks in advance!

Dim cnn As New OleDbConnection(stringConnect) 
        Dim ds As New DataSet()
            Dim da As New OleDbDataAdapter("select * from TabSub where CodSup=" & CLng(Cb1.SelectedValue), cnn) 
            Me.Cb2.DisplayMember = "Descr"
            Me.Cb2.ValueMember = "CodeAcc"
            Me.Cb2.DataSource = ds.Tables(0)
        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try

You'll need to provide the code that runs with the save button, as you are describing the problem to appear on save.
If Cb2 get's populated OK, then probably the code you are posting is irrelevant to your problem.

I'm using a binding navigator and the code when I save the register is :


The second combobox (Cb2), after I save the register, seems to "loose" the binding source...
Any ideas?


Well, I think I found the answer myself....(some hours spent...)
After I save the record, I 'recover' cb2 databinding, and it's ok.

Thank you!

This question has already been answered. Start a new discussion instead.