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!

how do u pass data from one form to another?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
hi.. i'm wondering... how do u pass data from one form to another?... both forms are in the same project.
 
You can do it by lot of methods, some methods have been listed here

1. Place the data to be passed on the forms.tag and retrieve wherever you need

2. Place it in a global project level variable declared in module and retrieve it

Is this enough

Ananth-India
 
You can pass data from Form1 to Form2 by creating a Sub in Form2 with arguments representing the data you wish to pass.
e.g.
In Form2 you have:


Public Sub DataIn(SomeData as string, MoreData as integer)
MyData=SomeData
MyMoreData=MoreData
End Sub

You will also need:
Dim MyData as String
Dim MyMoreData as Integer
in the general declarations section of Form2

From Form1 you probably have something like:

Form2.Show
Form2.DataIn StringData, IntegerData

In Form2, MyData will contain Form1's StringData & MyMoreData will be Form1's IntegerData

Hope this helps
 
hai
It is easy to pass data from one form to another

Eg: if u have text1, text2 in form1 and u want to pass it to a combo in form2
Form1:
text1.text="Hello"
text2.text="Mathi"
FOrm2:
combo1.text=form1.text1.text
combo2.text=form1.text1.text

Try this
KEEP SMILING
regards,
MathiKrishna


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top