I am using the function below in the exit event of a text box and to
test it I am using/////. However, this gives me a type mismatch error on
Len(strToCheck) . Is / considered a special character or am I
implementing this function incorrectly?
--Code Start--
Public Function IsClean(strToCh eck) As Boolean
Dim lng As Long
Dim bln As Boolean
If Len(strToCheck) > 0 Then
For lng = 1 To Len(strToCheck)
Select Case Asc(Mid$(strToC heck, lng, 1))
Case 65 To 90
' Letters A to Z
Case 97 To 122
' Letters a to z
Case Else
bln = True
Exit For
End Select
Next lng
End If
IsClean = Not bln
End Function
--Code End--
Thanks
Colin
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
test it I am using/////. However, this gives me a type mismatch error on
Len(strToCheck) . Is / considered a special character or am I
implementing this function incorrectly?
--Code Start--
Public Function IsClean(strToCh eck) As Boolean
Dim lng As Long
Dim bln As Boolean
If Len(strToCheck) > 0 Then
For lng = 1 To Len(strToCheck)
Select Case Asc(Mid$(strToC heck, lng, 1))
Case 65 To 90
' Letters A to Z
Case 97 To 122
' Letters a to z
Case Else
bln = True
Exit For
End Select
Next lng
End If
IsClean = Not bln
End Function
--Code End--
Thanks
Colin
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Comment