Link to home
Start Free TrialLog in
Avatar of snyperj
snyperjFlag for United States of America

asked on

Variables suddenly lose their set values

Why would variables suddenly lose their values when  form loads?  I have a variable that I set to 'true' when the form loads... and I check it at different stages using a message box.  It remains 'true' all the way through the code.   The variable is then used in the after_update of a textbox... when I put a value in the textbox, the variable is gone... somehow it is getting wiped and I can't figure out why...  other ones (global) that are either set on previous forms also disappear.   This was all working up until yesterday...so it has to be something I did yesterday, but I am at a loss as to what it could be.

Are there any certain things I should check that might cause variables to lose their values suddenly?


Thanks
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Did you add a "Stop" statement anywhere in your code recently?  That causes all globals to be lost.
Actually, Stop does not clear variables:

From Help:
"The Stop statement suspends execution, but unlike End, it doesn't close any files or clear variables, unless it is in a compiled executable (.exe) file."

Where are this Globals located?  In a vba module? Form module?

mx
Also ... does you code compile?

Are any errors occurring ... and then End is being hit?  End will clear variables.

mx
Avatar of snyperj

ASKER

No stop  and the globals are in a vba module.

The code does compile.
Can you single step through the code .. .from the point where the variable is set ... to where it's gone?

mx
SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of snyperj

ASKER

I would post it but the .mdb is only a front end, the entire be is SQL.
Avatar of snyperj

ASKER

I'll find it... it will just probably take all day to back track and slowly remove yesterdays work until it is working again. groan.. is it 5pm yet?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of snyperj

ASKER

Thanks, I'll get it because I am sure it is helpful...but in this case it is all variables that were previously set that are getting wiped..
"I am sure it is helpful.."
I promise ... more than you can know :-)

mx
Avatar of snyperj

ASKER

Thanks