SES Source Code Lines Count 8/22/2026 --------- VBA SOURCE to Generate this is provided far below too --------- --------- SUMMARY ------------------------------------------------------- --------- 32200 line(s) in 38 stand-alone module(s) ------------------ --------- 134444 line(s) in 116 module(s) behind forms ----------------- --------- 43754 line(s) in 5 module(s) behind reports --------------- --------- TOTAL --------------------------------------------------------- --------- 210398 line(s) in 159 module(s) ------------------------------ CountLines 306 APIs 115 Buttons 140 clsSESBtnItem 461 clsSESBtnProcessor 75 clsTimer 102 clsXMLRequest 264 ColorPicker 722 Constants 443 DragDropOLE 943 Drilling Engineering 5393 Drilling Procedures 781 Dsk 268 DskMore 140 DskWin 1263 ExportImport 200 Fav 94 FDDC 1679 MDBOut 4574 MDBUser 261 Misc 78 MouseHook 63 MousePointer 28 mTimers 237 Notify 158 OCU 262 OpenFile 1730 PELibraryV8 176 Printer 2775 Procedures 2038 PTuner2 280 RTR 100 ScreenMonitor 3771 Security 501 Sorting 150 TimeZones 205 Windows 996 WITSML 428 XSec2 32200 line(s) in 38 stand-alone module(s) 3844 Form_FormButtons1 1969 Form_FormButtons2 1252 Form_frm3DView01 2522 Form_frm3DView02 24 Form_frmDigitizedWellBore 24 Form_frmDigitizedWellPlan 283 Form_frmLegal 22 Form_frmLoadSES 50 Form_frmQuit 108 Form_frmSizePesgo 2264 Form_frmThdLogs 850 Form_frmWizConfigWServers 548 Form_frmWizCopy3DSB2 32 Form_frmWizCopy3DSB2_sfrm1 41 Form_frmWizCopy3DSB2_sfrm2 410 Form_frmWizCopyLWD 449 Form_frmWizCopyMBed 442 Form_frmWizCopyPlan 472 Form_frmWizCopySurv 331 Form_frmWizCopyTypeLog 454 Form_frmWizCopyXSec 343 Form_frmWizCreateTypeLog2 1181 Form_frmWizExportXml 2616 Form_frmWizImportLAS 1944 Form_frmWizImportWLwd 1200 Form_frmWizImportWSurvey 1109 Form_frmWizOCU 428 Form_frmWizPickTypeLogs2 572 Form_frmWizPickWellWServer 829 Form_frmWizPokeThicks 261 Form_frmWizPrint 1646 Form_frmWizPT2DefaultsMgr 3664 Form_frmWizPT2LoadPlus 79 Form_frmWizPT2LoadPlus_sfrm 4324 Form_frmWizRTR 495 Form_frmWizSetActiveWell 32 Form_frmWizSetActiveWell_sfrm 1338 Form_frmWizSetBackImg 1195 Form_frmWizSetCLParams 267 Form_frmWizSetDeleteBlocks2 636 Form_frmWizSetDivisorAdder2 285 Form_frmWizSetInsertBlocks2 2003 Form_frmWizSetProj 32 Form_frmWizSetProj_sfrm1 32 Form_frmWizSetProj_sfrm2 32 Form_frmWizSetProj_sfrm3 947 Form_frmWizSetSummary 416 Form_frmWizSurvAnnoSettings 2922 Form_frmWizXSecSettings 199 Form_msgAbout 184 Form_msgHelpGeosteer 185 Form_msgHelpGRIDS 185 Form_msgHelpLWD 185 Form_msgHelpParamTuner 182 Form_msgHelpPlanner 182 Form_msgHelpSES 182 Form_msgHelpSurveys 182 Form_msgHelpTHD 182 Form_msgHelpTHDLogs 182 Form_msgHelpTL 182 Form_msgHelpUTILITIES 182 Form_msgHelpWELLS 182 Form_msgHelpXSec 216 Form_msgNotifyL 216 Form_msgNotifyM 216 Form_msgNotifyS 154 Form_msgOntheWeb 1706 Form_subDragDropImpXLS 82 Form_subDragDropOcheck 140 Form_subDragDropOLwdA 140 Form_subDragDropOLwdU 140 Form_subDragDropOSurvA 140 Form_subDragDropOSurvU 114 Form_subformLoading 114 Form_subformLoadingLt 13 Form_subformSESzHeader 294 Form_subformzDirPlanDetail 3100 Form_subformzDirPlanHeader 40 Form_subformzDirPlanSecDetail 42 Form_subformzDirSurveyAnno 41 Form_subformzDirSurveyCalcsNoTHD 223 Form_subformzDirSurveyDetail 3943 Form_subformzDirSurveyHeader 63 Form_subformzGridDetail0 86 Form_subformzGridDetail1 1515 Form_subformzGridHeader 1140 Form_subformzHeader 105 Form_subformzHeaderDelete 31 Form_subformzHeaderExport 214 Form_subformzLwdDetailCalcs 4843 Form_subformzLwdHeader 1944 Form_subformzMBedsDetailCalcs 1564 Form_subformzMBedsHeader 41 Form_subformzThdCalcs 36 Form_subformzThdCalcsMBeds 1512 Form_subformzThdHeader 210 Form_subformzTLDetail 4663 Form_subformzTLHeader 4832 Form_subformzXSecHeader 3214 Form_zzDesk 2424 Form_zzGRIDS 866 Form_zzHome 109 Form_zzLoading 3636 Form_zzMainDb 2383 Form_zzMainLic 408 Form_zzMainNet 395 Form_zzMainOpt 422 Form_zzMainUp 274 Form_zzMainWits 1641 Form_zzMnu 546 Form_zzMnuFile 752 Form_zzMnuLeft 29892 Form_zzPT 1624 Form_zzSES 145 Form_zzUtil 2045 Form_zzWELLS 134444 line(s) in 116 module(s) behind forms 14520 Report_rptCrossSection1 14522 Report_rptCrossSection5 14522 Report_rptCrossSection9 95 Report_rptDigitizedWellbore 95 Report_rptDigitizedWellPlan 43754 line(s) in 5 module(s) behind reports 210398 line(s) in 159 module(s) ___________________________________________________________________________________ Save below into Module named LinesCounter, Compile, and call CountLines ___________________________________________________________________________________ Option Compare Database Option Explicit 'Purpose: Count the number of lines of code in your database. 'Author: Allen Browne (allen@allenbrowne.com) 'Release: 26 November 2007 'Copyright: None. You may use this and modify it for any database you write. ' All we ask is that you acknowledge the source (leave these comments in your code.) 'Documentation: http://allenbrowne.com/vba-CountLines.html Private Const micVerboseSummary = 1 Private Const micVerboseListAll = 2 Public Function CountLines(Optional iVerboseLevel As Integer = 3) As Long On Error GoTo Err_Handler 'Purpose: Count the number of lines of code in modules of current database. 'Requires: Access 2000 or later. 'Argument: This number is a bit field, indicating what should print to the Immediate Window: ' 0 displays nothing ' 1 displays a summary for the module type (form, report, stand-alone.) ' 2 list the lines in each module ' 3 displays the summary and the list of modules. 'Notes: Code will error if dirty (i.e. the project is not compiled and saved.) ' Just click Ok if a form/report is assigned to a non-existent printer. ' Side effect: all modules behind forms and reports will be closed. ' Code window will flash, since modules cannot be opened hidden. Dim accObj As AccessObject 'Each module/form/report. Dim strDoc As String 'Name of each form/report Dim lngObjectCount As Long 'Number of modules/forms/reports Dim lngObjectTotal As Long 'Total number of objects. Dim lngLineCount As Long 'Number of lines for this object type. Dim lngLineTotal As Long 'Total number of lines for all object types. Dim bWasOpen As Boolean 'Flag to leave form/report open if it was open. 'Stand-alone modules. lngObjectCount = 0& lngLineCount = 0& For Each accObj In CurrentProject.AllModules 'OPTIONAL: TO EXCLUDE THE CODE IN THIS MODULE FROM THE COUNT: ' a) Uncomment the If ... and End If lines (3 lines later), by removing the single-quote. ' b) Replace MODULE_NAME with the name of the module you saved this in (e.g. "Module1") ' c) Check that the code compiles after your changes (Compile on Debug menu.) If accObj.Name <> "LinesCounter" Then lngObjectCount = lngObjectCount + 1& lngLineCount = lngLineCount + GetModuleLines(accObj.Name, True, iVerboseLevel) End If Next lngLineTotal = lngLineTotal + lngLineCount lngObjectTotal = lngObjectTotal + lngObjectCount If (iVerboseLevel And micVerboseSummary) <> 0 Then Debug.Print lngLineCount & " line(s) in " & lngObjectCount & " stand-alone module(s)" Debug.Print End If 'Modules behind forms. lngObjectCount = 0& lngLineCount = 0& For Each accObj In CurrentProject.AllForms strDoc = accObj.Name bWasOpen = accObj.IsLoaded If Not bWasOpen Then DoCmd.OpenForm strDoc, acDesign, WindowMode:=acHidden End If If Forms(strDoc).HasModule Then lngObjectCount = lngObjectCount + 1& lngLineCount = lngLineCount + GetModuleLines("Form_" & strDoc, False, iVerboseLevel) End If If Not bWasOpen Then DoCmd.Close acForm, strDoc, acSaveNo End If Next lngLineTotal = lngLineTotal + lngLineCount lngObjectTotal = lngObjectTotal + lngObjectCount If (iVerboseLevel And micVerboseSummary) <> 0 Then Debug.Print lngLineCount & " line(s) in " & lngObjectCount & " module(s) behind forms" Debug.Print End If 'Modules behind reports. lngObjectCount = 0& lngLineCount = 0& For Each accObj In CurrentProject.AllReports strDoc = accObj.Name bWasOpen = accObj.IsLoaded If Not bWasOpen Then 'In Access 2000, remove the ", WindowMode:=acHidden" from the next line. DoCmd.OpenReport strDoc, acDesign End If If Reports(strDoc).HasModule Then lngObjectCount = lngObjectCount + 1& lngLineCount = lngLineCount + GetModuleLines("Report_" & strDoc, False, iVerboseLevel) End If If Not bWasOpen Then DoCmd.Close acReport, strDoc, acSaveNo End If Next lngLineTotal = lngLineTotal + lngLineCount lngObjectTotal = lngObjectTotal + lngObjectCount If (iVerboseLevel And micVerboseSummary) <> 0 Then Debug.Print lngLineCount & " line(s) in " & lngObjectCount & " module(s) behind reports" Debug.Print lngLineTotal & " line(s) in " & lngObjectTotal & " module(s)" End If CountLines = lngLineTotal Exit_Handler: Exit Function Err_Handler: Select Case Err.Number Case 29068& 'This error actually occurs in GetModuleLines() MsgBox "Cannot complete operation." & vbCrLf & "Make sure code is compiled and saved." Case Else MsgBox "Error " & Err.Number & ": " & Err.description End Select Resume Exit_Handler End Function Private Function GetModuleLines(strModule As String, bIsStandAlone As Boolean, iVerboseLevel As Integer) As Long 'Usage: Called by CountLines(). 'Note: Do not use error handling: must pass error back to parent routine. Dim bWasOpen As Boolean 'Flag applies to standalone modules only. If bIsStandAlone Then bWasOpen = CurrentProject.AllModules(strModule).IsLoaded End If If Not bWasOpen Then DoCmd.OpenModule strModule End If If (iVerboseLevel And micVerboseListAll) <> 0 Then Debug.Print Modules(strModule).CountOfLines, strModule End If GetModuleLines = Modules(strModule).CountOfLines If Not bWasOpen Then DoCmd.Close acModule, strModule, acSaveYes End If End Function