See if this helps you out...
Code:
Option Explicit
Private Function IsError(asTextIn As String) As Boolean
' This function returns true if there is an error in asTextIn
Dim Counter As Integer
Dim TempChar As String
' Check to see that asTextIn is 12 characters
' or less and the first character is not a "."
If Len(asTextIn) > 12 Or Left$(asTextIn, 1) = "." Then
IsError = True
Exit Function
Else
' For each character in asTextIn
For Counter = 1 To Len(asTextIn)
TempChar = Mid$(asTextIn, Counter, 1)
' If the character is "#" or "?" or "/" then return an error
If TempChar = "#" Or TempChar = "?" Or TempChar = "/" Then
IsError = True
Exit Function
' Or if the character is "." and there are more
' than 3 characters after it, return an error
ElseIf TempChar = "." And (Len(asTextIn) > (Counter + 3)) Then
IsError = True
Exit Function
End If
Next ' Counter
End If
End Function
[Edited by seaweed on 11-09-2000 at 08:44 PM]