Inappropriate use of <keyword> keyword in a module

Modules do not have instances, support inheritance, or implement interfaces. Therefore, the following keywords do not apply to a module declaration:

The only keywords supported in a Module Statement are Public (Visual Basic) and Friend (Visual Basic).

In addition, you cannot use the Implements (Visual Basic) statement or the Inherits Statement in the statement block of the module.

By default, this message is a warning. For more information about how to hide warnings or treat warnings as errors, see Configuring Warnings in Visual Basic.

Error ID: BC42028

To correct this error

  • If you intend this programming element to be a module, use only the Public or Friend keyword in its declaration. By default, a module uses to Friend if you do not specify its access level.

  • If you intend to create instances of this programming element, declare it as a class. You can then use the keywords that apply to a class declaration.

See Also


Class Statement (Visual Basic)