dbTalk Databases Forums  

Access 2003 VBA Modules

comp.databases.ms-access comp.databases.ms-access


Discuss Access 2003 VBA Modules in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Charles Hottel
 
Posts: n/a

Default Access 2003 VBA Modules - 02-17-2011 , 01:55 PM






Is there a way to determine how many lines of code are contained within a
VBA module? Thanks.

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Access 2003 VBA Modules - 02-17-2011 , 06:21 PM






Charles Hottel wrote:
Quote:
Is there a way to determine how many lines of code are contained within a
VBA module? Thanks.


This is straight out of help. It includes blank lines as well
Public Sub ModuleLineTotal1(ByVal strModuleName As String)

Dim mdl As Module

' Open module to include in Modules collection.
DoCmd.OpenModule strModuleName

' Return reference to Module object.
Set mdl = Modules(strModuleName)

' Print number of lines in module.
MsgBox "Number of lines: " & mdl.CountOfLines

' Print number of declaration lines.
MsgBox "Number of declaration lines: " & mdl.CountOfDeclarationLines

End Sub

Reply With Quote
  #3  
Old   
Charles Hottel
 
Posts: n/a

Default Re: Access 2003 VBA Modules - 02-17-2011 , 10:22 PM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
Charles Hottel wrote:
Is there a way to determine how many lines of code are contained within a
VBA module? Thanks.
This is straight out of help. It includes blank lines as well
Public Sub ModuleLineTotal1(ByVal strModuleName As String)

Dim mdl As Module

' Open module to include in Modules collection.
DoCmd.OpenModule strModuleName

' Return reference to Module object.
Set mdl = Modules(strModuleName)

' Print number of lines in module.
MsgBox "Number of lines: " & mdl.CountOfLines

' Print number of declaration lines.
MsgBox "Number of declaration lines: " & mdl.CountOfDeclarationLines

End Sub
Thanks.

Reply With Quote
  #4  
Old   
Charles Hottel
 
Posts: n/a

Default Re: Access 2003 VBA Modules - 02-19-2011 , 01:14 PM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
Charles Hottel wrote:
Is there a way to determine how many lines of code are contained within a
VBA module? Thanks.
This is straight out of help. It includes blank lines as well
Public Sub ModuleLineTotal1(ByVal strModuleName As String)

Dim mdl As Module

' Open module to include in Modules collection.
DoCmd.OpenModule strModuleName

' Return reference to Module object.
Set mdl = Modules(strModuleName)

' Print number of lines in module.
MsgBox "Number of lines: " & mdl.CountOfLines

' Print number of declaration lines.
MsgBox "Number of declaration lines: " & mdl.CountOfDeclarationLines

End Sub
There must be something about using Help in Access 2003 that I do not
understand or else Help is useless. Before I posted my question I search
for and answer for over 20 minutes and found nothing. After receiving you
answer I tried again to see what I could learn, but still no joy. Then I
went to Google and found a web page with this code right away.

Reply With Quote
  #5  
Old   
Albert D. Kallal
 
Posts: n/a

Default Re: Access 2003 VBA Modules - 02-19-2011 , 08:20 PM



?"Charles Hottel" wrote in message
news:2b-dnboXyb00i_3QnZ2dnUVZ_jSdnZ2d (AT) earthlink (DOT) com...

Quote:
There must be something about using Help in Access 2003 that I do not
understand or else Help is useless. Before I posted my question I search
for and answer for over 20 minutes and found nothing. After receiving you
answer I tried again to see what I could learn, but still no joy. Then I
went to Google and found a web page with this code right away.
For user stuff like how to hit tab key to go to the next text box on a form,
you use help form the forms or user side.

For code help, one great tip is to make sure you are in the code editor
before you launch help.

In the VBA ide, I launched help, and then I typed in:

Count of lines

The first hit in help was the correct answer and even had sample code.

So, when looking for coding help the tip of the day here is to launch + use
help from the code editor of Access and not the end user part such as when
in a form, or report. (if you are editing code in a form, then you do get
good code help).

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
Pleasenospam_kallal (AT) msn (DOT) com

Reply With Quote
  #6  
Old   
Charles Hottel
 
Posts: n/a

Default Re: Access 2003 VBA Modules - 02-19-2011 , 10:13 PM



"Albert D. Kallal" <PleaseNOOOsPAMmkallal (AT) msn (DOT) com> wrote

?"Charles Hottel" wrote in message
news:2b-dnboXyb00i_3QnZ2dnUVZ_jSdnZ2d (AT) earthlink (DOT) com...

Quote:
There must be something about using Help in Access 2003 that I do not
understand or else Help is useless. Before I posted my question I search
for and answer for over 20 minutes and found nothing. After receiving you
answer I tried again to see what I could learn, but still no joy. Then I
went to Google and found a web page with this code right away.
For user stuff like how to hit tab key to go to the next text box on a form,
you use help form the forms or user side.

For code help, one great tip is to make sure you are in the code editor
before you launch help.

In the VBA ide, I launched help, and then I typed in:

Count of lines

The first hit in help was the correct answer and even had sample code.

So, when looking for coding help the tip of the day here is to launch + use
help from the code editor of Access and not the end user part such as when
in a form, or report. (if you are editing code in a form, then you do get
good code help).

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
Pleasenospam_kallal (AT) msn (DOT) com

Ok Thanks. I was not in the code editor.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.