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 !
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,579
Location
Sydney, Australia
Programming Experience
10+
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?
 

ebrahim

Member
Joined
Jul 13, 2011
Messages
8
Programming Experience
Beginner
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:

ebrahim

Member
Joined
Jul 13, 2011
Messages
8
Programming Experience
Beginner
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
 
Top Bottom