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

Setting the Globla Array variables to nothing??

Status
Not open for further replies.

bnath001

Programmer
Aug 18, 2000
100
US
I have declard some global Array variables in the Module files and after finishing the processing how can I intialize the global array variables to nothing?

Public gltest(1 To 4, 1 To 10)

If I don't initialize the global array variable to nothing does it hog the memory?

thank you
nath
 
Public Sub InitGlobalVariables()

Dim intInnerLoop As Integer
Dim intOuterLoop As Integer

For intOuterLoop = 0 to 3
For intInnerLoop = 0 To 9
gltest(intInnerLoop) = 0
Next intInnerLoop
Next intOuterLoop

End Sub

Put the above code in a module by itself then create a macro that runs the module. Name this Macro Autoexec. When you open your app Access will see the Autoexec and run this first and formost initializing your global variables.

HTH
 
Thank you I will do that.

But I am using an access form and with local access tables and few Oracle tables (connected thru a ODBC DSN). I have linked the oracle tables into my access database using linked table manager.

When User clicks on the Generate button, it does bunch of calcuations in the oracle tables and exits out.
But when the user clicks on the Generate button again, it will say MSACCESS.EXE error. so far I have not been re-intializing the global array variables. Do you think that could be a problem?

I am taking care of pointing the recordsets to nothing at the end of each function though.

any input is very helpful
thanks
nath
 
You are not closing the connections to the oracle db after you do your calculations are?. I am not sure what the prob would be. I only use an ODBC connection from my VB5 to MySql. So I don't know much about how Access handles it sorry I can't be of more help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top