Carrying variables values from one subform to another

R

RHov

I have a form with two separate subforms. One subform
has monthly data and the other has cumulative data for
the year. After the value for the 12th month of a year
is reached, the focus is switched to the corresponding
year in the cumulative subform. I need to set the value
of a variable which will then be used in the validation
procedure for the cumulative subform. Are static
variables the way to handle this? If so, where do I
declare and set their values? I was able to pass one
value by using the parent.tag, but I need to pass more
than one variable. Any ideas?
 
R

Rod Scoullar

The easiest way is to declare global variables in a module.

eg

Public glngVariableName As Long

The variable glngVariableName can then be accessed from any part of the
program and will hold its value.

Rod Scoullar
 
N

news.east.earthlink.net

Yes. set public variables in the forms class module (at the beginning of the
code after Option statements). you can set and access them from any function
or sub in that form. example:

Option Explicit
Public strValueOne as String
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top