Public Arrays in a form

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

Guest

Hello guys 'n' Girls...

Relatively new to VBA+Access. I am trying to declare a public variable in a
form so that subsequent forms can access this variable while the form is
open. This variable needs to be an array (say array of Intergers). This was
my proposal:

Public IntArray(10) As Integer

However, access complains telling me arrays, user defined types, inter alia,
cannot be public members of object modules.... I assume object modules =
forms, reports... (feel free to pull the leash). So what can I do? Is the
only option open for me is to declare these in a Module? (As access hasn't
yet complained)

Thanks a mill
 
Hi,
You have to define public arrays in your a module.
you can create a new module and put all the declarations in there or
if you have one already add the new array or variable at the top of
the module.

as access says. public variables can not be defined in forms (object
level).
 
Hi,
You have to define public arrays in a module.
you can create a new module and put all the declarations in there or
if you have one already add the new array or variable at the top of
the module.

as access says. public variables can not be defined in forms (object
level).
 
Back
Top