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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant solve this.......binding to controls on another form

Status
Not open for further replies.

jadepatel

Technical User
Sep 4, 2002
35
0
0
GB
Hi,

I just have a quick databinding question. I have 2 forms......
Form1 is my main form containing all the controls i want to bind the results of my query to.
Form2 contains a datagrid containing a list of guests in the database. The user can click on a row to select a guest. They then hit the OK button. This will then run a query to retrieve that guests details from my database. What i now want to do is bind the results of the query from Form2 to the controls on Form1.

Does anyone know how to do this??
I know how to bind to controls on the same form but not when they are on a differnt form!!!

This is what i normally use....
Me.txtFName.DataBindings.Add(New Binding("Text", ds.Tables
("Guest"), "F_Name"))

in VB6 i would just replace 'Me' with the name of the other form, but this does not seem to work in VB.NET!!!!
i.e
Form1.txtFName.DataBindings.Add(New Binding("Text",
ds.Tables("Guest"), "F_Name"))

when i try the above i get the following error:
Reference to a non shared member requires an onject
refernce


Can anyone please help me?
Many thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top