by Rone (9 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 14th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Checks the ASCII code to validate characters.
Dim intASCII As Integer
intASCII = Asc(strChar)
'The following are the accepted characters in the ID field.
'45--> "-"
'48-57-->"0-9"
'65-90 -->"A-Z"
'95-->"_"
'97-199-->"a-z"
If (intASCII = 45) Or (intASCII > 47 And intASCII < 58) Or (intASCII > 64 And intASCII < 91) Or (intASCII = 95) Or (intASCII > 96 And intASCII < 123) Then
Else
Check_ASCII = True
End If
End Function