Field filter

G

Guest

I have a form iin which one of the fields is for the users to enter a serial
number. Unfortunately, in many cases, the serial numbers supplied to the
users are preceeded by the letter S, however I advised the user NOT to enter
the letter S. Of course, users being who they are, don't always follow
instructions.

Is there any way to setup the format section of the field properties to
disallow the letter S as the 1st character of this field?

Specs:
Field is TEXT
Length 25
I did it through a macro but it's not always reliable.
 
G

Guest

Use the Before Update event of the control where they put the serial number in:

If Left(Me.txtSerialNumber, 1) = "S" Then
Cancel = True
MsgBox "Didn't I tell you not to use the S", vbQuestion+vbOkayOnly,
"Moron Detected"
End If

Of course, you may want to use a different message :)
 

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

Top