Equivalent VB Code

D

David

Is there any known defects with respect to Databinding to
a ComboBox that is located on a UserForm?

I have a scenario on one of my forms that I have spent
HOURS trying to solve that has completely crushed my
morale.

Essentially I setup the combobox with a datasource and the
appropriate DataMember and Value Member (everything
appears perfect on the screen when I click the dropdown).
However when I fetch the data into the dataset the
contents of the ComboBox is always blank.
cboTerms.DataSource = dsLookup
cboTerms.ValueMember = "lk_Term.Term_pk"
cboTerms.DisplayMember = "lk_Term.Description"
Me.cboTerms.DataBindings.Add("SelectedValue",
dsCustomer, "Customer.LK_Terms_pk"))

dsCustomer.Fill()

I have also tried attaching a different BindingContext to
the Combo, also to no avail.

Two other combos on this screen are also behaving this way.

I have about 10 other forms in my application that operate
EXACTLY the same way without any problem(they are also on
usercontrols). Why just this particular screen?

If anyone has any ideas, anything at all, I'd be forever
grateful.

Down and out (but not for the count),

David
 
D

David Kozak

-----Original Message-----
Is there any known defects with respect to Databinding to
a ComboBox that is located on a UserForm?

I have a scenario on one of my forms that I have spent
HOURS trying to solve that has completely crushed my
morale.

Essentially I setup the combobox with a datasource and the
appropriate DataMember and Value Member (everything
appears perfect on the screen when I click the dropdown).
However when I fetch the data into the dataset the
contents of the ComboBox is always blank.
cboTerms.DataSource = dsLookup
cboTerms.ValueMember = "lk_Term.Term_pk"
cboTerms.DisplayMember = "lk_Term.Description"
Me.cboTerms.DataBindings.Add("SelectedValue",
dsCustomer, "Customer.LK_Terms_pk"))

dsCustomer.Fill()

I have also tried attaching a different BindingContext to
the Combo, also to no avail.

Two other combos on this screen are also behaving this way.

I have about 10 other forms in my application that operate
EXACTLY the same way without any problem(they are also on
usercontrols). Why just this particular screen?

If anyone has any ideas, anything at all, I'd be forever
grateful.

Down and out (but not for the count),

David

.
 
P

Peter Huang [MSFT]

Hi David,

I have replied to your another post in the newsgroup queue.
DataBinding problem with Combobox
You may have a check and let me know if that does the job for you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
 
Top