
01-19-2006, 04:37 AM
|
|
Freshman
|
|
Join Date: Oct 2005
Posts: 27
|
|
Problem passing value from Module
|
I have created a form which runs through files and checks whether they have certain information in them (a formchecker)
The form code is now growing out of control and I want to break it down and put them in functions in modules.
my code was working before I tried to do this but I cannot work out how to get the boolean response back into my form code.
Public Function isOptionExplicit(strLn As String) As Boolean
On Error GoTo ErrorHandler
If InStr(1, LCase$(strLn), "option explicit") > 0 Then
If Mid$(strLn, 1, 1) <> "'" Then 'check line isn't commented
If StrComp(Mid$(Replace(LCase$(strLn), Space(1), ""), 1, 14), "optionexplicit") = 0 Then
isOptionExplicit = True
Else
End If
End If
Exit Function
ErrorHandler:
MsgBox "CheckOptionExplicit", Err.Number, Err.Description
End Function
'''''
Trying to get the code back into the form code
if check1(checkenum.checkoptionexplicit).value = vbchecked then
if IsOptionExplicit(strLn) = true then 'This is where I want the boolean True or false to be brought back in
end if
But it is saying (strln) variable not defined....
What am I doing wrong
|
|