Public

This statement is used at module level to declare public variables and allocate storage space.

Syntax

Public varname[([subscripts])][, varname[([subscripts])]] . . .

Parameters

varname
Name of the variable; follows standard variable naming conventions.
subscripts
Dimensions of an array variable; up to 60 multiple dimensions can be declared. The subscripts parameter uses the following syntax:
upper [, upper] . . .

The lower bound of an array is always 0.

Remarks

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.