By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Pass string from form one to form 2

P: n/a
Is it possible to get a string or long integer saved into memory when
Form1 closes. Then when Form2 is opened, I can use the string or long
integer in the code for Form2?

Thanks
Ray
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ray Holtz wrote:
Is it possible to get a string or long integer saved into memory when
Form1 closes. Then when Form2 is opened, I can use the string or long
integer in the code for Form2?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can use a Public variable in a standard module.

Or,

If you're opening Form2 from Form1 you can pass the variable in the
OpenArgs. E.g.:

DoCmd.OpenForm "Form2", OpenArgs:=25

When Form2 opens it can read OpenArgs and get the value 25. E.g.:

Private Sub Form_Open(Cancel As Integer)

' This is Form2's OnOpen event procedure

If Not IsNull(Me.OpenArgs) Then
Debug.Print Me.OpenArgs
End If

End Sub
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQm11o4echKqOuFEgEQJ/EACfVbajYTU+1MLwNpEXYFpmnZ2S5v8AnR7H
Io9XkRxtY7xMV8NBbnq/SBN9
=+iMW
-----END PGP SIGNATURE-----
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.