Actual Problem with variables

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

How do you pass a variable to a form that isn't open yet?
It works if both forms are open. If form one opens form
two with a "buttonclick" the variable does not get passed.
 
bob said:
How do you pass a variable to a form that isn't open yet?
It works if both forms are open. If form one opens form
two with a "buttonclick" the variable does not get passed.


Use the OpenForm method's OpenArgs argument to pass the
value (as a string) to Form2. Form2's Load event can then
use a line of code to save the value somewhere in itself:

something = Me.OpenArgs

While Access will probably convert the string in OpenArgs to
whatever type something is, it is better to explicitly
convert it. E.g.

something = CDate(Me.OpenArgs)
 
Back
Top