Local variable '<variablename>' cannot be referred to before it is declared

A variable inside a procedure is used before its declaration.

Error ID: BC32000

To correct this error

  • Move the declaration to precede the first reference to the variable.

See Also

Concepts

Variable Declaration in Visual Basic