Solved

Count all lines of program code in MS Access database

Posted on 2014-09-11
4
1,013 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
4 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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 34

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
 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now