S
Stu
Hi all,
I am designing a project set up using a dozen or so public subs. They
are very simple, and i am using global variables (integers) to keep
track of usage statistics for each procedure.
Normally, each procedure runs fine, and adds 1 to its own usage stat.
I'm then outputting these to a text file at the end of each session,
and inputting them at the start of the next (no problems here).
Two of the procedures call (show) forms. My problem is that when the
forms close (either "unload" or just clicking "X"), the code returns
to "End Sub" in the calling procedure, and THEN....all my global
variables get cleared.
(I've checked the exact point by monitoring them line by line in the
Immediate window.)
But this doesnt happen with any of the other subs, only the two that
call forms.
Clearly im not getting something about global variables and/or forms.
Can anyone help? Also, if there isnt a simple explanation, possible
workarounds much appreciated.
Cheers
Stu
I am designing a project set up using a dozen or so public subs. They
are very simple, and i am using global variables (integers) to keep
track of usage statistics for each procedure.
Normally, each procedure runs fine, and adds 1 to its own usage stat.
I'm then outputting these to a text file at the end of each session,
and inputting them at the start of the next (no problems here).
Two of the procedures call (show) forms. My problem is that when the
forms close (either "unload" or just clicking "X"), the code returns
to "End Sub" in the calling procedure, and THEN....all my global
variables get cleared.
(I've checked the exact point by monitoring them line by line in the
Immediate window.)
But this doesnt happen with any of the other subs, only the two that
call forms.
Clearly im not getting something about global variables and/or forms.
Can anyone help? Also, if there isnt a simple explanation, possible
workarounds much appreciated.
Cheers
Stu