?
Solved

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

Posted on 2014-11-19
4
Medium Priority
?
518 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 40454356
Hi,

You could use the Trim function to eliminate the space

Regards
0
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 2000 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 51

Expert Comment

by:Gustav Brock
ID: 40454441
You are welcome!

/gustav
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

801 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