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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Public variable losing value? 1

Status
Not open for further replies.

Jonmit

Programmer
Aug 28, 2009
6
AU
I have declared a public variable in the Public declarations modules section and am setting its value to a field on a form in its 'after update' and 'on current' properties of the form(both are needed for different situations). When i come to use it to set another field on another form (not subform) it has lost its value. I thought public variables held their value till reset by some code.

thanks in advance
John
 
What exactly is "in the Public declarations modules section"?
Did you Dim the var as Public in a separate module? If you did it in the form's module it will go out of scope when the form closes (I think).

Cogito eggo sum – I think, therefore I am a waffle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top