Pass a variable through process

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

I have a variable, vApproval , that is created when Form1 is open and then
Form2 is opened from one of the command buttons in Form1. I would like to
use vApproval in Form2. How do I do this?

Thank you,

Steven
 
Here is what I would try.

Setup a text field on Form1, let say "text1". Then in one of the events, set
it to:

Me.Text1 = VApproval. Check to see if it populates

Open Form 2 and add another text field "text2".

Now, on the button event on Form 1 that opens Form 2 add something along
the lines of this:

Forms![Form2]![Text2] = Me.Text1

This is where I would start. I'm not MVP so maybe someone has a better
answer.
 
Steven said:
I have a variable, vApproval , that is created when Form1 is open and then
Form2 is opened from one of the command buttons in Form1. I would like to
use vApproval in Form2. How do I do this?


If this variable is to be used across multiple forms and/or
reports, then you can make it a property of an always open
form (Form1?). This is done by simply declaring it as
Public in the form module's declarations area (before any
sub or function statements):

Public vApproval As whatever

Then, as long as the form is open you can use it just about
anywhere with this kind of syntax:

Forms!Form1.vApproval
 
Back
Top