R
Randy
Hi,
I'm trying to populate textbox values upon a change in a combobox
selection. I'm using the Publishers table in the Pubs sample database
as a simplified example. Here is the code:
Private Sub cboPubID_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cboPubID.SelectedIndexChanged
Dim PubsDS As New PUBSDataSet()
Dim PubsTA As New
PUBSDataSetTableAdapters.publishersTableAdapter
PubsTA.Fill(PubsDS.publishers)
txtPubName.Text =
PubsDS.Tables("publishers").Rows(cboPubID.Text)(1).ToString
txtCity.Text = PubsDS.Tables("publishers").Rows(cboPubID.Text)
(2).ToString
End Sub
The last two lines are where I am trying to lookup the field values in
columns 1 and 2 based on the row as determined from the combobox
selection. These lines aren't working. I've tried searching this
board for the answer, but no luck.
Anybody know how to do this?
Thanks,
Randy
I'm trying to populate textbox values upon a change in a combobox
selection. I'm using the Publishers table in the Pubs sample database
as a simplified example. Here is the code:
Private Sub cboPubID_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cboPubID.SelectedIndexChanged
Dim PubsDS As New PUBSDataSet()
Dim PubsTA As New
PUBSDataSetTableAdapters.publishersTableAdapter
PubsTA.Fill(PubsDS.publishers)
txtPubName.Text =
PubsDS.Tables("publishers").Rows(cboPubID.Text)(1).ToString
txtCity.Text = PubsDS.Tables("publishers").Rows(cboPubID.Text)
(2).ToString
End Sub
The last two lines are where I am trying to lookup the field values in
columns 1 and 2 based on the row as determined from the combobox
selection. These lines aren't working. I've tried searching this
board for the answer, but no luck.
Anybody know how to do this?
Thanks,
Randy