valuemember and displaymember for a combobox



This code does not work :

With m_frmCtrl.cboMode
.DataSource = m_dsCtrl.Tables(4)
.ValueMember = "ModeID"
.DisplayMember = "Description"
.SelectedValue = ds.Tables(0).Rows(curRow).Item("ModeID")
End With

The line .DisplayMember triggers the following error :

Could not bind to the new display member.

If I invert those two lines :

.DisplayMember = "Description"
.ValueMember = "ModeID"
I got this error :

Could not bind to the new value member.

I've checked m_dsCtrl.Tables(4) and it contains everything right.

This is driving me crazy, can someone help please ?

Cor Ligthert


Mostly is this an upercase lowercase error.
This is in windowsform case sensitive.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question