Wadelf
07-15-2017, 03:56 PM
MS Office 365, MS Access, VBA
I know I can use a Module public (global) variable, but it would seem that I should (and maybe have in past versions) be able to use a public variable declared on top of the form code that would retain it's value between events?
I set it's value in an event, then right after, in another event, the value is gone? If I call another procedure, function, class module, etc. from an event the value is maintained, but after the event ends the value is gone?
I am very old school when in the late 80s programs would have a memory leak and keep using memory, so I feel that a Module global variable would use memory/performance/etc when I should be able to declare a variable within a form and it will keep it's value while the form is open even between events, as a public (global) module variable does throughout the application while the app is open. A public (global) module variable works. I thought I once did this years ago?
I know I can use a Module public (global) variable, but it would seem that I should (and maybe have in past versions) be able to use a public variable declared on top of the form code that would retain it's value between events?
I set it's value in an event, then right after, in another event, the value is gone? If I call another procedure, function, class module, etc. from an event the value is maintained, but after the event ends the value is gone?
I am very old school when in the late 80s programs would have a memory leak and keep using memory, so I feel that a Module global variable would use memory/performance/etc when I should be able to declare a variable within a form and it will keep it's value while the form is open even between events, as a public (global) module variable does throughout the application while the app is open. A public (global) module variable works. I thought I once did this years ago?