Public Variables usage in Access 2003

J

JOE COOL

I have been developing a accounting system with Access
2003 using public/global variables.

The public variables will be initialised after login
procedures. The accounting system will proceed from login
form, to menu form, then to data entry form, and so on.

Each time, when a form is opened, some public variables
will be initialised with some unique number or text
information for security and other reasons.

However, each time when I encounter some minor problems
here and there while using the system, the public variable
values seem to disappear! Most of the public variables
will contain a null value instead of the values that I
have initialised earlier!

In order to solve the problem, I have to close all the
data entry forms, the menu forms and then login again...
where the public variables will be initialised again.

Question : Why can't the public variables contain the
information permanently unless a new initialisation is
done by me? The values of the public variables seem to
disappear when the slightest problem occur whilst using
Access 2003.

Can any one help? Thanks a million
 
A

Allen Browne

When you reset after any error, the reset applies to all variables,
including the public ones.

One workaround is to place the value in a hidden text box on a form.

Another is to run the intializing routine again if your variant is Empty.

Another is to store the values in a table, and read them from there.
 

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