Make text box mandatory and numbers only

X

XP

In Office 2003, I have a text box control on a form. I want to restrict this
text box to numbers only from 1 to 20 digits in length and I want to make
this text box mandatory for completion...

How can I do this? Thanks.
 
B

BruceM

Before I get into an explanation, is this a question about Microsoft Access?
I ask because people are misdirected from the Microsoft web site with some
frequency, and you have only specified Office 2003, not a specific program
within that suite.
The simplest way in Access is to make the table field to which the control
is bound a required field, and to limit its length (assuming it is a text
field) to 20. You can add your own validation rule and message, if you
wish.
Another way is to use the form's After Update event to examine the text box,
and to produce a message if it doesn't pass muster.
 
B

BruceM

Oops. I forgot that you specified numbers. I still think it needs to be a
text field, but you could use an input mask (see Help for more information)
to limit it to numeric characters.
 
Top