G
Guest
I'm trying to publically define a dynamic array, arrSub() in the declarations
section of my code for a particular form. The array is designed to accept a
chaning number of string variables, and will be used by other forms and
modules throughout the running of my program.
The following code begins my module:
Option Compare Database
Option Explicit
Option Base 1
Public arrSub() As Variant
When I debug, I get an error message: "Constants, fixed-length strings,
arrays, user-defined types and Declare statements not allowed as Public
members of object modules."
The Help file gives the following advice: "Although a procedure can't return
an array, it can return a Variant that contains an array. To simulate a
Public array in a class module, use a set of Property procedures that accept
and return a Variant containing an array."
I'm not sure what to make of that, but I know that dynamic arrays can be
defined as public somehow. Does anyone have any ideas. Many thanks in
advance.
Joe
section of my code for a particular form. The array is designed to accept a
chaning number of string variables, and will be used by other forms and
modules throughout the running of my program.
The following code begins my module:
Option Compare Database
Option Explicit
Option Base 1
Public arrSub() As Variant
When I debug, I get an error message: "Constants, fixed-length strings,
arrays, user-defined types and Declare statements not allowed as Public
members of object modules."
The Help file gives the following advice: "Although a procedure can't return
an array, it can return a Variant that contains an array. To simulate a
Public array in a class module, use a set of Property procedures that accept
and return a Variant containing an array."
I'm not sure what to make of that, but I know that dynamic arrays can be
defined as public somehow. Does anyone have any ideas. Many thanks in
advance.
Joe