?
Solved

Count all lines of program code in MS Access database

Posted on 2014-09-11
4
Medium Priority
?
1,228 Views
Last Modified: 2014-09-11
I would like to know how many lines of VBA program code is contained in my Access 2010 database.

I suppose the best way to do this is to export all code into MS Word and let Word count the number of paragraphs. It would take a while to manually open every module, form, and report to copy and paste the code into MS Word.

Is there a way to automate exporting all the program code--or to simply count the number of lines of code?

By the way, if I put the code into MS Word, I will delete all the blank lines before counting.
0
Comment
Question by:gordonwwaugh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 40317477
Access doesn't really store that information, but the free MZTools VBA utility has a Statistics feature:

www.mztools.com

Install that, then open the VB Editor, and you'll find MZ Tools under the Tools menu there.
MZ ToolsMZ Tools even tells you the number of blank lines ... really an amazing tool for free (although you can donate to the author if you'd like).
0
 
LVL 38

Expert Comment

by:PatHartman
ID: 40317503
I like MzTools also but here's an alternative.  The file includes a link to the website I copied the code from.
CountLinesOfCode.docx
0
 
LVL 1

Author Closing Comment

by:gordonwwaugh
ID: 40317517
MZ-Tools is awesome! Thanks very much for telling me about it. This will save me a lot of time in the future.
0
 
LVL 75
ID: 40317789
Long live MZTools ...
And FYI ... there is a recent newer VBA version ... so, be sure you  have the latest ... if you have not downloaded in day the last six months or so.

mx
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question