Link to home
Start Free TrialLog in
Avatar of jfgrayiii
jfgrayiii

asked on

Form view question

If I use a form view component how do I referance that field in vb

example formview1  has a field called "name"  when I try to referance this field in the vb source. it tell me that name is not declared
Avatar of jake072
jake072
Flag of Canada image

I'm not sure I understand what you mean by "field"...  Do you mean Property?  If so, make sure it's accessible outside the class

Jake
Avatar of jfgrayiii
jfgrayiii

ASKER

If I have a textbox out of a form view I can type

me.textbox1.text = "blah blah"

If that text box is used in a form view  or data grid

me.textbox1 will say not declared

me.parent.textbox1.text = "blah blah"

You have to refer to the parent of your control (the form), and then access it's controls.

Jake
how would I referance a field from

sqldatasource1
 in
formview1 ?
You can set it when you create the FormView1...

For Instance, you could say (in FormView1):

Private SqlDataSource1 As SqlDataSource

Sub New(ByRef SqlDataSource1 As SqlDataSource)
    Me.SqlDataSource1 = SqlDataSource1
End Sub

Now you can access SqlDataSource1 from your FormView1.

Hope that helps,

Jake
If I drop a text box on a form I can double click on that box and write vb code

example.

me.textbox1.text = "0"

If I insert a form view component right click on it, go to edit templete, and add a textbox and double click on it
me.textbox1.text does not work  it says textbox 1 not declared how do I declare a referance to textbox1 in a form view


 
I am using visual studio 2005 btw
ASKER CERTIFIED SOLUTION
Avatar of jake072
jake072
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial