Prefix Letter in a text box

  • Thread starter Thread starter Alex Martinez
  • Start date Start date
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top