Question can not send integer combobox value to textbox

ebrahim

Member
Joined
Jul 13, 2011
Messages
8
Programming Experience
Beginner
Hi all
Im trying to send integer value from combobox in form 1 to textbox in form 2
I try use this code on form2 :


VB.NET:
me.textbox.text = form1.combobox.selectedvalue

This code works with a textbox does not have a data source but when I set the data source for the textbox, code does not appear Value
What's wrong !
 
Um, TextBoxes don't have a DataSource. Do you mean setting the DataSource of the ComboBox? What are you setting the DataSource to? Are you setting the ValueMember?
 
Mr.jmcilhinney thank you to help me and i mean in the properties of textbox set the DataBindings of textbox to table in the database ,, plz see the photo

bay way my English Language is poor :)
this.jpg

i hope it is clear
 
Last edited:
thank you Mr.jmcilhinney the wrong it was not in the code ,, it was in the event thank you again Moderator :peaceful:

Private Sub FirstFieldInForm_KeyDown
me.textbox.text = form1.combobox.selectedvalue
End Sub
 
Back
Top