Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep the value of the variable saved unless database is closed?

Status
Not open for further replies.

Jawad77

Programmer
Dec 23, 2004
41
US
I am assigning a value to the variable in a subprocedure behind my second form. When I move to my first form, value of the variable is gone. I like to save this value even when I navigate from my second form to my first form.

I tried to define my variable as static but it doesn't work.

Any ideas/thoughts how to accomplish this? Thanks!

Jay
 
A (real) public variable is declared in the declaration section of a standard module (i e - in VBE Insert | Module, then right after the lines Option Compare Database and Option Explicit (you have the last one too, haven't you?), declare the public:

[tt]public gmyvariable as <yourdatatype>[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top