Looking at the posted DB there really isn't much to go on.
Your form code only shows a moveSize routine which I would do in the load event.
your AddGuardFileRefs routine is useless as the references are already checked off in the the DB references. If your trying to insure that other users have those references then using late binding is usually the way to go.
Your example Db does not call this code.
As far as your code using VBE extensibility, while I'm familiar with it, I have never seen code where you attempt to concatenate the prefix "Form_" with a form name work. But I could be wrong.
Code:
CodeLineCount = Modules("Form_" & SearchForm).CountOfLines + 1 'This is where it normally fails with runtime error 7961 (Line 30)
Maybe something like this would work for you.
Code:
Sub CountCodeLines(Frm As String)
Dim objComponent As Object
Dim strName As String
For Each objComponent In Application.VBE.ActiveVBProject.VBComponents
strName = objComponent.Name
If strName = "Form_" & Frm Then
Debug.Print strName, objComponent.CodeModule.CountOfLines
End If
Next
End Sub
HTH.