Solved

Count all lines of program code in MS Access database

Posted on 2014-09-11
4
1,074 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 35

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Filter a form 8 15
My SQL as Backend for Access 3 18
backup program with robocopy 6 22
Sum with where criteria on a report 5 16
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…

809 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