comobobox won't display values

G

Guest

Hi everyone, i'm pretty much stuck at this problem. I have 3 comboboxes and
the selected value in combobox1 will determine the value to display for
combobox2 and the selected value in combobox2 will determine the value
display in combobox3. The problem is that i am able to get the value to
display for combobox2 but i can't get the values to display for combobox3.
Below are my codes. can anyone help?

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

Dim ds1 As New DataSet

ds1 = methods.SelectWard(ComboBox1.Text)
ComboBox2.ValueMember = "WARD"
ComboBox2.DisplayMember = "WARD"
ComboBox2.DataSource = ds1.Tables("WARD")
ComboBox2.Visible = True

End Sub

Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ComboBox2.SelectedIndexChanged
Dim ds As New DataSet

ds = methods.SelectBed(ComboBox2.Text)
ComboBox3.ValueMember = "BED_NO"
ComboBox3.DisplayMember = "BED_NO"
ComboBox3.DataSource = ds.Tables("BED")
ComboBox3.Visible = True

End Sub
 
G

Guest

Hi Kies,

I don't think your code is having any problem. It may be due to the Column
name "BED_NO" you specified in the datatable "BED" might be misspelled or
wouldn't be of same type.
 

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

Top