Remembering Values

spectrolab

Registered User.
Local time
Today, 09:19
Joined
Feb 9, 2005
Messages
119
Hi All,

Is there anyway that I can get access to "remember" values in a private sub routine after the sub routine has closed and use that value again once the sub routine is run the next time?

My value might be say 14 after the sub routine is run the first time, so I would want to start at 15 the next time the routine is run.

Any ideas?
 
Create the variable as public in your declarations instead of private, that should work.
 
Thanks James,

Didn't even think of that, much appreciated.
 
No probs, don't forget to rep me... trying to get up to two green thingies under my name :)
 
Just an additional thought; If the private sub routine is going to need to start at a specific value after Access has been closed, then the value to be incremented may need to be saved to a table each time it is incremented. Also, if this is a multi-user application using the "split method" for distribution, then you might really want to consider the table method.
 
save it to the registery.
savesetting/getsetting functions

but, this won't work for multi user application.
public variable won't work for multi user application too.
 

Users who are viewing this thread

Back
Top Bottom