Prefix Letter in a text box

A

Alex Martinez

Hello,

I have a form which a claims examiner inputs policy number into the
database. Unfortunately the examiner does not put the correct prefix letter
in the text box. For example the policy number will be:

T097894 or V018913

What I need is to make sure that the examiner inputs a "T" or "V" then the
numbers. How can I code it so the user put in a "T" or "V" and have the
form reject if the perfix is different? Any tips will be appreciated.
Thank you in advance.
 
T

tina

in the policy number control's BeForeUpdate event, add validation code, as

Dim strLtr As String
strLtr = Left(Me!PolicyNumberControlName, 1)

If Not (strLtr = "T" Or strLtr = "V") Then
Cancel = True
Msgbox "Policy number must begin with T or V."
End If

hth
 
Top