Global variants

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I need a little help. I have two procedures in my code:

Private Sub Form_Open(Cancel As Integer)
.....
Dim Arr() As Variant
.....
End Sub

Private Sub Form_Close()
.....
End Sub

In the first procedure I create and populate an array. How can I use this
array in the Form_Close procedure? Is there a way to define global variants?
 
hi,
In the first procedure I create and populate an array. How can I use this
array in the Form_Close procedure? Is there a way to define global variants?
Declare your array at the beginning of the form module as

Private m_Arr() As Variant


mfG
--> stefan <--
 
Do the Dim at the module level, that is right after the Options statements in
the Form module. That way it is visible to all procedures in the module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top