Name '<name>' is not declared

A statement refers to a programming element, but the compiler cannot find an element with that exact name.

Error ID: BC30451

To correct this error

  1. Check the spelling of the name in the referring statement. Visual Basic is case-insensitive, but any other variation in the spelling is regarded as a completely different name. Note that the underscore (_) is part of the name and therefore part of the spelling.

  2. Check that you have the member access operator (.) between an object and its member. For example, if you have a TextBox control named TextBox1, to access its Text property you should type TextBox1.Text. If instead you type TextBox1Text, you have created a different name.

  3. If the spelling is correct and the syntax of any object member access is correct, verify that the element has been declared. For more information, see Declared Elements.

  4. If the programming element has been declared, check that it is in scope. If the referring statement is outside the region declaring the programming element, you might need to qualify the element name. For more information, see Scope in Visual Basic.

See Also

Declarations and Constants Summary
Visual Basic Naming Conventions
Declared Element Names
References to Declared Elements