
Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
That dog just won’t hunt, Doug!
ElseIf UCase(Left(Me!Text1, 1) < "A" Or UCase(Left(Me!Text1, 1) > "Z" Then
needs some extra parentheses
ElseIf UCase(Left(Me!Text1, 1)) < "A" Or UCase(Left(Me!Text1, 1)) > "Z" Then
and
ElseIf CLng(Mid(Me!Text0, 2)) <> Val(Mid(Me!Text0, 2)) Then
throws an Error 13 Type Mismatch if an alpha character is entered
How about this:
Private Sub Text0_BeforeUpdate(Cancel As Integer)
If Len(Text1) <> 7 Then
MsgBox "Book Code Must Be 1 Letter Followed By 6 Digits!"
Cancel = True
End If
If Not ((Asc(Left(Text1, 1)) >= 65) And (Asc(Left(Text1, 1)) <= 90))_
And Not ((Asc(Left(Text1, 1)) >= 97) And (Asc(Left(Text1, 1)) <= 122)) Then
MsgBox "The First Character of the Book Code Must Be a Letter"
Cancel = True
End If
If Not IsNumeric(Right(Text1, 6)) Or InStr(Text1, ".") > 1_
Or InStr(Text1, "+") > 1 Or InStr(Text1, "-") > 1 Then
MsgBox "Last 6 Characters of the Book Code Must Be Numeric!"
Cancel = True
End If
End Sub
>Try the following for your text box's BeforeUpdate event:
>
[quoted text clipped - 19 lines]
>>
>> Please help. Thanks.

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000
Douglas J. Steele - 28 Jul 2007 00:08 GMT
Yeah, you're right. Thanks for the assist.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> That dog just won't hunt, Doug!
>
[quoted text clipped - 55 lines]
>>>
>>> Please help. Thanks.
AccessHelp - 30 Jul 2007 23:20 GMT
Hi guys,
Thank you very much for your helps. I hope you guys can help me one more
thing. I see a problem when the user space-bars through the book code and
when the user puts zero for the last 6 digits (e.g. "A000000").
Can you guys help me with the code for these situations?
Thanks.
> Yeah, you're right. Thanks for the assist.
>
[quoted text clipped - 57 lines]
> >>>
> >>> Please help. Thanks.