Something like this could work.
Code:
Function TestPass(strPass as string) As Boolean
Dim j as Integer
Dim lp as Integer
Dim FoundLC As Boolean
Dim FoundUC As Boolean
Dim FoundNum As Boolean
' Set result to false
testPass = False
' Test length
lp = len(txtPass)
if lp < 8 or lp > 12 then
Exit Function
end if
'test each character for each required element
FoundLC = False
FoundUC = False
FoundNum = False
For j = 1 to lp
Select Case mid(strPass,j,1)
Case "a" through "z"
FoundLC = True
Case "A" through "Z"
FoundUC = True
Case "1" through "9", "0"
FoundNum = True
End Select
Next j
' If all required elements have been found,
' set true, otherwise leave false
If FoundLC AND FoundUC AND FoundNum Then
testPass = True
End If
End Function