Solved

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

Posted on 2014-11-19
4
456 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 50

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

791 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