How to pass the value of a text from a form to other form

samuvk

Registered User.
Local time
Today, 05:32
Joined
Mar 3, 2010
Messages
24
I have the value of a text in form1 and I want to pass the value to the form2. How can I do that?

I tried something like:

Dim Text As string

text = text1.Value


Forms![Form2Name].Textinform2.Value = text

But it doesn't work

Thanks
 
That works if the first form is still open when the second form is opened. Other than that, use the Help in the VBE, this forum or online for "OpenArgs".

HTH,
-dK
 
Since TEXT is a reserved word in Access that may be part of your problem.

From code on form 1 you can basically use:

Forms!Form2NameHere.ControlNameHere = Me.ControlNameHere
 
Good catch, SOS.

samuvk, this link is a good resource to prevent any potential conflict to ensure you are not using reserved words.

-dK
 

Users who are viewing this thread

Back
Top Bottom