passing variables between forms

S

SweetDot

Hi,
I want to access a variable that i've declared in the declaration section of another form from the main form.
what is the easiest way to do it?
the line of code looks like this:
While Form!frmSeason!commandClicked = False
but it's giving me object not defined error

thanks for the help in advance
 
W

woloman

Try declaring a public variable in a database-level module
instead of within the form module. That way, you can
access its value from anywhere in the program.

If you don't have a module in your database already,
create one. Type something like the following in the
Declarations section (the very top of the module):

Public blnSeason As Boolean

That's it. Now, you just need to assign the value:

blnSeason=Form!frmSeason!commandClicked

The revised statement would read

While blnSeason = False

-----Original Message-----
Hi,
I want to access a variable that i've declared in the
declaration section of another form from the main form.
 

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