Solved

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

Posted on 2014-11-19
4
402 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 48

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now