The combo box is set at form_load with the following code.
'Form_Load()
With cboBroker
.DataSource=dsBroker
.DisplayMember="Name"
.ValueMember="Code"
End With
'Set the dataset position to 0
daBroker.Fill(dsBroker)
me.BindingContext(dsBroker).Position=0
txtCode.text=dsbroker.tables(0).Item(0)
txtName.text=dsbroker.tables(0).Item(1)
End Sub
Private Sub cboBroker_SelectedIndexChanged()
Me.BindingContext(dsbroker).Position=cboBroker.SelectedIndex
txtCode.text=dsbroker.tables(0).Item(0)
txtName.text=dsbroker.tables(0).Item(1)
End Sub
The Problem is that if I bind any one textbox with the dsBroker Dataset,
then it works fine otherwise changing the combobox at first time does not
change the position of dataset.
For example: When the form is loaded, it displays Code 1 and relative name
in combo box.
When I select the combo box and display the 2nd name in combo box, the Code
is still 1 instead of 2.
When I again select the combo box and display the 1st name, the Code now
shows 2 instead of 1.
If I delete the dsBroker ActiveX from form and create a new dataset in the
General Declaration form, everything works fine.
'General Declaration
Dim dsBroker as new Dataset
Any Idea why the position of combo box is not synchronizing with the
dataset in case of using Dataset ActiveX Control.
Best Regards,
Luqman
"Russ Green" <rgr...@rgreen.karoo.co.uk> wrote in message news:e3RvC2enCHA.2228@TK2MSFTNGP12...
"Russ Green" <rgr...@rgreen.karoo.co.uk> wrote in message news:OmzldxrnCHA.2408@TK2MSFTNGP10...