Arg81
Well-known member
Kinda down the lines of something I posted a while ago, and I don't see what's causing this problem.
Form:
User selects a customer. Clicks on SELECT, this pops up a model customer select form. customer name and customer ID are saved as a variable and the customer select form is closed.
The customer name is then put into the label to display the selection, and the customer ID is put into a textbox hidden behind the name.
The Customer Contact dataTable is then filled using the ID value, and the names display in the contact combobox.
The code for this is:
Now, the names display. 7/10 times the customer will only have 1 contact, so the contact name isn't changed.
By doing this, the "Value" of that row isn't copied to the main table column "selected value" with the rest of the data of the form
Is this a bug in VS, or is there a line of code I can add so it will force the row in the combobox to update or something like that?!?
If the user selects another contact, or if they reselect the same contact, it's fine - the problem only exists if the user doesn't actually choose someone from the combobox list.
The only way I can see of doing it is to call
Me.CustomerContactTableAdapter.FillByCustomerID(Me.DsCustomerDetails.CustomerContact, Me.lblCustomerID.Text)
when the contact CBO is entered....
Form:
User selects a customer. Clicks on SELECT, this pops up a model customer select form. customer name and customer ID are saved as a variable and the customer select form is closed.
The customer name is then put into the label to display the selection, and the customer ID is put into a textbox hidden behind the name.
The Customer Contact dataTable is then filled using the ID value, and the names display in the contact combobox.
The code for this is:
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] frm [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] frmCustomerSelect[/SIZE]
[SIZE=2]frm.ShowDialog()[/SIZE]
[SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].lblCustomerName.Text = varCustomerSiteName[/SIZE]
[SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].lblSiteID.Text = varSiteID[/SIZE]
[SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].lblCustomerID.Text = varCustomerID[/SIZE]
[SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].CustomerContactTableAdapter.FillByCustomerID([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].DsCustomerDetails.CustomerContact, [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].lblCustomerID.Text)[/SIZE]
[SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].cboCustomerContact.Focus()[/SIZE]
Now, the names display. 7/10 times the customer will only have 1 contact, so the contact name isn't changed.
By doing this, the "Value" of that row isn't copied to the main table column "selected value" with the rest of the data of the form
Is this a bug in VS, or is there a line of code I can add so it will force the row in the combobox to update or something like that?!?
If the user selects another contact, or if they reselect the same contact, it's fine - the problem only exists if the user doesn't actually choose someone from the combobox list.
The only way I can see of doing it is to call
Me.CustomerContactTableAdapter.FillByCustomerID(Me.DsCustomerDetails.CustomerContact, Me.lblCustomerID.Text)
when the contact CBO is entered....