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!

Loosing Global variabel

Status
Not open for further replies.

cmdata

Programmer
Mar 18, 2005
5
SE
Hi is there any that, can help me?
I have a Access 2000 db with a lot of VBA code in it.
And i Using some global varibel's and the problem I have
is when every I debug or some code error I loose the global varible is the some way to get a Global variable
to get rely static. That keep it's value to the bitter end ?
 
Hi cmdata,

Obviously if you are losing it, it isn't really global, so how and where is your global variable defined? Or do you only lose it when you debug?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Hello Tony!

Thanks for your respond.

The variable is declared in top of my function (modules)
When program is running and all is working I don't lossing variable, I only loose this when debug, or on some program error, It is hard to debug error beacurse of that many function is depending of this Global variables.
 
Hi cmdata,

Sorry, there is nothing I know that makes global variables behave differently in debug mode. You can clear them if you press End following an error but then you are no longer in debug mode.

I'm not sure what to suggest beyond normal techniques. Is it one particular variable, or all of them? Is it declared as Public if used outside the module? How is it initialised? If you single step your process from the beginning is there some point where you lose it?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top