Option ClassModule

Isi

# Option ClassModule Statement

Specifies that the module is a class module that contains members, properties, procedures and functions.

Pernyataan ini harus ditambahkan sebelum kode program yang dapat dieksekusi dalam modul.

### Parameter:

This statement must be used jointly with Option Compatible statement or Option VBASupport 1, the former is enabling VBA compatibility mode, while the latter is enforcing VBA support on top of compatibility.

### Sintaksis:

Option ClassModule

### Contoh:

             Option Compatible
             Option ClassModule

             ' Optional members go here

             Private Sub Class_Initialize()
                 ' Optional construction code goes here
             End Sub ' Konstruktor
             Private Sub Class_Terminate()
                 ' Optional destruction code goes here
             Destructor Akhir Sub

             ' Properties go here.

             ' Procedures & functions go here.

Topik Terkait

Refer to Identifying the Operating System and Getting Session Information for class module simple examples.

Multiple thorough class examples are available from Access2Base shared Basic library.

Pernyataan Option Base

Pernyataan Option Explicit

Pernyataan Option VBASupport

Option Compatible Statement