O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

G.10. The Module Object

The Module object refers to either a standard module or a class module within your database.

G.10.1. Module Object Properties

The Module object's properties are described in the following table.

PropertyData TypeDescription
ApplicationApplication objectReturns the currently active Application object.
CountOfDeclaration-LinesLongCount of the number of lines in the General Declarations section of a standard or class module.
CountOfLinesLongCount of lines of code in a standard or class module.
LinesStringContains the contents of a specified line or lines in a standard or class module.
NameStringReturns the name of the standard or class module.
ParentObjectUsually the Application object.
ProcBodyLineLongContains the number of the line at which the body of the specified procedure begins.
ProcCountLinesLongContains the number of lines in a specified procedure of a standard of class module.
ProcOfLineStringContains the name of the procedure that contains the specified line in a standard or class module.
ProcStartLineLongIdentifies the line at which a specified procedure begins in a standard or class module.
TypeAcModuleType EnumIndicates whether a module is a standard module or a class module

G.10.2. Module Object Methods

The methods for the Module object are listed in the following table.

MethodArgumentsDescription
AddFromFileFileNameAdds the contents of the text file to a module.
AddFromStringStringAdds the contents of the string to a module.
CreateEventProcEventName, ObjectName ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required