Public/Global Variables

M

Morris.C

Does anyone know of any problems/bugs with Public/Gobal variables in
Access2003.

While trying to fix up a previous problem (my previous post about combo-
boxes) I decided to use a public variable to get a value from one form to
another.

I put "Public intVar1 As Integer" in the declartion part of the module
where it gets set.
When I try to use it in the next form, I get an error saying "Variable not
defined."

Any thoughts?
 
W

Wayne Morgan

What module did you put the variable in? You should declare it in a standard
module, not a form module. Also, if you are testing and get a break in the
running of the code, such as when an error occurs, it may be possible to
lose the value of the variable if the project resets.
 

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