There are many ways to check for numbers/letters. Here is my way:
Code:
Public Function ValidateField(pTheField As String) As Boolean
Dim tmp 'holds char
Dim IsValid As Boolean
Dim k As Integer 'counter
ValidateField = False
'format = AA###AAA###
' check length. must be 11 chars
If Len(pTheField) = 11 Then
For k = 1 To 11
tmp = Mid(pTheField, k, 1)
Select Case k
Case 1, 2, 6, 7, 8
IsValid = InStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", UCase(tmp))
If Not IsValid Then
'MsgBox "not a letter at position " & k
Exit Function
End If
Case 3, 4, 5, 9, 10, 11
If Not IsNumeric(tmp) Then
'MsgBox "not a number at position " & k
Exit Function
End If
End Select
Next
ValidateField = True
End If
End Function
This function will return TRUE or FALSE.
Call it : IF ValidateField(Me.ProjectID) =TRUE then