Public Arrays in a form

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
 
N

Naeem Azizian

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).
 
N

Naeem Azizian

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).
 

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

Top