Data Entry

C

Charles

I have an OrderNumber field that is the primary key for a table of orders.

I want to force the user not to use spaces or dashes when entering a new
order number. This usually happens accidently on the users part but it
happens often enough that I would like to have a message box pop up saying
something to the effect "Only Alpha numeric characters are allowed for the
Order Number"

Thanks

Charles
 
G

Guest

Create an input mask property for the text box where you enter the OrderNumber.
It would be AAAAA for the length of an order number if entry is required and
will accept numbers and letters or aaaaa for the length of an order number if
entry is not required. If it is not letters or numbers only, see Input Mask
in VBA Help for codes.
 
J

John Vinson

I have an OrderNumber field that is the primary key for a table of orders.

I want to force the user not to use spaces or dashes when entering a new
order number. This usually happens accidently on the users part but it
happens often enough that I would like to have a message box pop up saying
something to the effect "Only Alpha numeric characters are allowed for the
Order Number"

Thanks

Charles

Are there ANY other constraints on the order number - length? mix of
alphas and numbers? That is, would "A" and "31243AAWQ3401DDY8" both be
valid order numbers?

I'm GUESSING that this might be one of the few cases where an Input
Mask would be useful - but that would be simplest if there were a
fixed size and pattern. For instance if all order numbers were two
letters followed by five digits, you could use a mask

AA00000


John W. Vinson[MVP]
 
C

Charles

Thanks for your reply

There are no other constraints. The user should be able to type either a
letter or a number anywhere within the 10 position limit. Also, they should
be able to enter 1 to 10 characters. I think the input mask forces you to
use a set number of positions.

We just want the user to be allowed to use whatever combination of
Alpha-numeric "Order Number" they decide on, however we must limit their
ability to use spaces, "/", "?", "@", etc...Alpha-Numeric only.

Charles
 
G

Guest

Charles,
See my previous post. If it is 1 to 10 characters, either letters or
numbers, then the Input Mask should be:
Aaaaaaaaaa

This will require only 1 character be entered because of the upper case A.
The other 9 are optional because of the lower case a. You can then enter
from 1 to 10 characters and they will be limited to letters and digits.
 
C

Charles

Thank You,

It works perfect.

Later

Charles

Klatuu said:
Charles,
See my previous post. If it is 1 to 10 characters, either letters or
numbers, then the Input Mask should be:
Aaaaaaaaaa

This will require only 1 character be entered because of the upper case A.
The other 9 are optional because of the lower case a. You can then enter
from 1 to 10 characters and they will be limited to letters and digits.
 

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