Solved

Input Mask in Access textbox. Allow only digits, no spaces.

Posted on 2014-11-19
4
446 Views
Last Modified: 2014-11-19
I have a textbox on a form where I only want to allow either four or five digits with no spaces.
Mask     00009     requires at least that the first four entries are digits and the fifth one can either be a digit OR A SPACE.
How can I prevent users from adding a space at the end of the four digits? There must either be a digit or nothing.
Unfortunately the field format is text and can for reference reasons not be changed.
0
Comment
Question by:Fritz Paul
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40454356
Hi,

You could use the Trim function to eliminate the space

Regards
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 40454421
> a digit or nothing.

But that is "9". When saved, Access strips trailing spaces.
If used for a variable, apply (as already noted) Trim or even RTrim.

/gustav
0
 

Author Closing Comment

by:Fritz Paul
ID: 40454437
Thanks. I did not even try, because I read http://office.microsoft.com/en-za/access-help/input-mask-syntax-and-examples-HP005187550.aspx
It says there
9      Digit or space (entry not required; plus and minus signs not allowed).
So I did not want to allow a space.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40454441
You are welcome!

/gustav
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

774 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question