DataBinding & CurrencyManager

Roey

Junior Contributor
Joined
Oct 10, 2002
Messages
238
Location
Canada
I have a form with a tab control on it. One tab displays Billing Addresses and another tab displays Shipping Addresses.

I am populating the State (Province)/ Country combo boxes on each tab using the same dataset

Private Sub LoadProvince()

Me.dsProvince.Clear()
Try
Me.dsProvince = objProvince.All
Me.cboBillingProvince.DataSource = Me.dsProvince.Tables("Province")
Me.cboBillingProvince.DisplayMember = "Description"
Me.cboBillingProvince.ValueMember = "ProvID"
Me.cboShippingProvince.DataSource = Me.dsProvince.Tables("Province")
Me.cboShippingProvince.DisplayMember = "Description"
Me.cboShippingProvince.ValueMember = "ProvID"


My problem is that the selection on one tab affects the other as the comboboxes seem to be bound together.
 
Managed to fix this by creating a separate BindingContext for each tab page

Me.tabBilling.BindingContext = Me.BindingContext
Me.tabShipping.BindingContext = New BindingContext()
 
Back
Top