Used at module level to declare public variables and allocate storage space.
Public varname[([subscripts])][, varname[([subscripts])]] . . .
The Public statement syntax has these parts:
Part | Description |
---|---|
varname | Name of the variable; follows standard variable naming conventions. |
subscripts | Dimensions of an array variable; up to 60 multiple dimensions may be declared. The subscripts argument uses the following syntax:
The lower bound of an array is always zero. |
Variables declared using the Public statement are available to all procedures in all forms in all projects.
A variable that refers to an object must be assigned an existing object using the Set statement before it can be used. Until it is assigned an object, the declared object variable has the special value Nothing.