By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,218 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,218 IT Pros & Developers. It's quick & easy.

Binding combobox to display foreign field data

P: n/a
I have a combobox that I use to display the advertising medium that
attracted a client. On the Client's table is the foreign key
AdvertisingMedium, and the combobox successfully reads the data from
the AdvertisingMedium table by using a Category class to read the data
into an array. I then set the datasource to read the array into the

With cboAdvertisingMedium
.DisplayMember = "Name"
.ValueMember = "ID"
.DataSource = arrAdvertising
End With

This bit of things works fine!

In the load event for the form, I bind the combobox to the foreign key
field of a view

cboAdvertisingMedium.DataBindings.Clear() ' this is also fine
cboAdvertisingMedium.DataBindings.Add("SelectedVal ue", objDataView,
"AdvertisingMedium") ' the problem seems to be here

All my text boxes load using this method. There are no error messages
here, but the combo box fails to display the either the valuemember or
the dsiplaymember from the underlying table. Obviously I would want
it to display the displaymember "Word of Mouth" insted of the
valuemember 5.

At the moment nothing is being displayed in the combobox. What am I
doing wrong?

Can somebody help?

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.