Data Validation

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

G'day everyone.

Wondering how I limit someone from entering in non numeric or alphabetic
characters into a textbox on a form. Do I do this within a form or in my
table design.

I'm wanting the user to be able to use:
a to z
A to Z
1 to 0

I don't want them to use !@#$%^&*()'";:,./<>?{}[] etc etc

Hope you can help,
Cheers
Simon
 
Wondering how I limit someone from entering in non numeric or alphabetic
characters into a textbox on a form. Do I do this within a form or in my
table design.

The input mask is designed to control users' keystrokes in this fashion,
but is often unpopular because it makes the text box behave quite unlike
anything else in the Windows GUI.

You can watch the KeyPress event to catch illegal keys, or you can use the
BeforeUpate event to check for an illegal entry.

In all cases, you should have a field level Validation Rule to prevent
updating of the field to an illegal value, via VBA, SQL, queries, the
datasheet, etc, etc. Try something like

Is Null Or Not Like "*[!0-9a-zA-Z]*"


Hope that helps


Tim F
 
Hi Simon,

Try this in the validation rule for the field (in Table Design):

Not Like "*[!0-9A-Za-z]*"

G'day everyone.

Wondering how I limit someone from entering in non numeric or alphabetic
characters into a textbox on a form. Do I do this within a form or in my
table design.

I'm wanting the user to be able to use:
a to z
A to Z
1 to 0

I don't want them to use !@#$%^&*()'";:,./<>?{}[] etc etc

Hope you can help,
Cheers
Simon
 

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