Dean said:
Is there a way to determine how many lines of "programmer" custom code are
in an .adp without manually counting them?
I don't think an ADP would be any different from this MDB
code I use:
Public Function LinesOfCode() As Long
Dim dbCur As Database
Dim doc As Document
Set dbCur = CurrentDb
' Count lines of code in Modules
For Each doc In dbCur.Containers("Modules").Documents
DoCmd.OpenModule doc.Name
LinesOfCode = LinesOfCode + _
Modules(doc.Name).CountOfLines
DoCmd.Close acModule, doc.Name, acSaveNo
Next doc
' Count lines of code in Forms
For Each doc In dbCur.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign
With Forms(doc.Name)
If .HasModule Then
LinesOfCode = LinesOfCode + _
.Module.CountOfLines
End If
End With
DoCmd.Close acForm, doc.Name, acSaveNo
Next doc
' Count lines of code in Reports
For Each doc In dbCur.Containers("Reports").Documents
DoCmd.OpenReport doc.Name, acDesign
With Reports(doc.Name)
If .HasModule Then
LinesOfCode = LinesOfCode + _
.Module.CountOfLines
End If
End With
DoCmd.Close acReport, doc.Name, acSaveNo
Next doc
Set dbCur = Nothing
End Function