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

Sharing an array between functions

Status
Not open for further replies.

susheel777

Programmer
Apr 28, 2003
17
0
0
SG
I've recently started using VB so excuse me if this question seems a little basic. (no pun intended!)

I am writing a VB6 program with a single form but several subs. I want to declare an array that is to be used in several subs. How can I do this? Do I need to put the DIM statement in the Form_load sub or can I just put it in any of the subs?

Thanks!
 
You should use Dim before any of subs (I think it should be written "General" and "Declarations" on top of your code window.)

Hope this helps.
 
Thanks! Looks like this is exactly the answer i was looking for!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top