Delen via


Specified access '<accesslevel1>' for '<partialtypename>' does not match the access '<accesslevel2>' specified on one of its other partial types

A class or structure is defined in multiple partial declarations with conflicting access level specifications.

When you divide the definition of a class or structure among several partial declarations, the compiler treats the type as the union of all its partial declarations. This applies not only to the members but also to the implementation, inheritance, and access level.

You cannot mix access levels in the definition of a class or structure. Even the combination Protected Friend is allowed only when the keywords are contiguous in the same declaration statement.

Error ID: BC30925

To correct this error

  • Decide what the access level of the class should be, and remove any conflicting access level specifications.

See Also

Concepts

Access Levels in Visual Basic

Classes: Blueprints for Objects

Reference

Partial (Visual Basic)

Class Statement (Visual Basic)

Structure Statement

Other Resources

Structures: Your Own Data Types