Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem populating a field in another table from a dropdown list

Status
Not open for further replies.

tonygr

Technical User
Jan 20, 2005
42
GB
Hi All,
Can Anybody help, I have a sql_2000 db which has two tables, I am using vs.net2005 (VB.net) as a front end. I have a form with a drop down box on it, populated from table1.centre when the user makes a selection from the drop down list I would like the value selected to go into table2.centre field along with the other details submitted on the form.
I can get the list of values to display but it doesnt seem to populate the table2.centre.
I have probably done it wrong from the outset.
I should also point out that I am a newbie and would greatly appreciate step by step help on this.
although any help or pointers would be a great help.
Yours sincerley
Tony
 
Without seeing any of your code, I can't point to an error. However, the process that you need to take is using an insert command with your information. Post back with what you have and we can help you learn the proper path.
 
Thanks for the reply!
Ok here gos, I will do my best to provide the info.
on the form in design view the when the combo is highlighted it produces a arrow top right, click into this then
tick databinding mode
Data Source = centredescriptionbindingsource
Display Member = centre_description
Value member = Centre_description
selected value = (none)
I then double click the combo box to go to the code and this is what I get relating to the combo

private sub combobox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedndexChanged

End Sub

here is all the code displayed below sorry if this isnt relevent
Public Class AddInduction

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Close()
End Sub

Private Sub InductionsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InductionsBindingNavigatorSaveItem.Click
Me.Validate()
Me.InductionsBindingSource.EndEdit()
Me.InductionsTableAdapter.Update(Me.FlexDataDataSet.Inductions)

End Sub

Private Sub Q7ATextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Q7ATextBox.TextChanged

End Sub

Private Sub Q7ALabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub AddInduction_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'FlexDataDataSet.CentreDescription' table. You can move, or remove it, as needed.
Me.CentreDescriptionTableAdapter.Fill(Me.FlexDataDataSet.CentreDescription)
'TODO: This line of code loads data into the 'FlexDataDataSet1.Inductions' table. You can move, or remove it, as needed.
Me.InductionsTableAdapter1.Fill(Me.FlexDataDataSet1.Inductions)

End Sub

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

End Sub
End Class
I hope this is what is needed.
Thanks Again
Tony
 
can anybody help me with a insert command?
Thanks in advance
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top