Variable getting zeroed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know why a variable declared outside the procedures in a form
might get zeroed. The variable is loaded from Openargs in the Form_Open
event. This is possibly happening after an error is raised which is handled
by 'on resume next'. It's declared outside because it's needed by multiple
procedures and I thought this would be easier than passing it around in
parameters.
Thanks.
 
Does anyone know why a variable declared outside the procedures in a form
might get zeroed. The variable is loaded from Openargs in the Form_Open
event. This is possibly happening after an error is raised which is handled
by 'on resume next'. It's declared outside because it's needed by multiple
procedures and I thought this would be easier than passing it around in
parameters.

Do you mean a Global or Public variable? If so, this is pretty common behavior. You're much better off passing the
variable around and allowing the various objects to "store" it as needed, or store the variable in a table and pull it
as needed.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
No, its not declared as Global, its just declared outside of the procedures
in a form module. Does that make it global? I believe its local to the form
module.
 

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

Back
Top