Hello Friends I have the following piece of code and I want to show the number of modules in the database. I tried it but it is not working.
Code:
Private Sub Command27_Click()
On Error GoTo Err_Command27
Dim lngCounterA As Long, lngCounterB As Long, lngCounterC As Long
Dim modModule As Module
Dim zahl
Dim zahl1
Dim zahl2
For i = 0 To CodeDb.Containers("Modules").Documents.Count - 1
RetVar = AllProcs(CodeDb.Containers("Modules").Documents(i).Name)
Next i
For lngCounterA = 0 To Modules.Count - 1
Set modModule = Modules.Item(lngCounterA)
zahl = 0
With modModule
For lngCounterB = 1 To .CountOfLines
If Trim(.Lines(lngCounterB, 1)) = "EOF" Then
' .ReplaceLine lngCounterB, "Washington"
zahl = zahl + 1
End If
Next lngCounterB
' Debug.Print "EOF kam im Modul " & modModule & " " & zahl & " mal vor."
zahl1 = 0
For lngCounterC = 1 To .CountOfLines
If Trim(.Lines(lngCounterC, 1)) = "Recordset" Then
' .ReplaceLine lngCounterC, "Washington"
zahl1 = zahl1 + 1
End If
Next lngCounterC
End With
'Debug.Print "Recordset kam im Modul " & modModule & " " & zahl1 & " mal vor."
Me.Text28 = Me.Text28 & vbNewLine & "Recordset kam im Modul " & modModule & " " & zahl1 & " mal vor."
Next lngCounterA
Exit_Command27:
Exit Sub
Err_Command27:
MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
Resume Exit_Command27
End Sub