First statement of a method body cannot be on the same line as the method declaration

A Function, Sub, Get, Set, or Property statement must be alone on a source code line.

Error ID: BC30040

To correct this error

  1. Remove any line label preceding the procedure declaration.

  2. Move any statement preceding the procedure declaration to a previous source code line.

  3. Move any statement following the procedure declaration to a subsequent source code line.

See Also

Tasks

How to: Label Statements

Concepts

Procedures in Visual Basic