473,910 Members | 6,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Input Masks

ADezii
8,834 Recognized Expert Expert
The following characters define an Input Mask:

Character - Description
0 - Digit (0 to 9, entry required, plus [+] and minus [–] signs not allowed).
9 - Digit or space (entry not required, plus and minus signs not allowed).
# - Digit or space (entry not required; spaces are displayed as blanks while in Edit mode, but blanks are removed when data is saved; plus and minus signs allowed).
L - Letter (A to Z, entry required).
? - Letter (A to Z, entry optional).
A - Letter or digit (entry required).
a - Letter or digit (entry optional).
& - Any character or a space (entry required).
C - Any character or a space (entry optional).
. , : ; - / Decimal placeholder and thousand, date, and time separators. (The actual character used depends on the settings in the Regional Settings Properties dialog box in Windows Control Panel).

< - Causes all characters to be converted to lowercase.
> - Causes all characters to be converted to uppercase.

! - Causes the input mask to display from right to left, rather than from left to right. Characters typed into the mask always fill it from left to right. You can include the exclamation point anywhere in the input mask.

\ - Causes the character that follows to be displayed as the literal character (for example, \A is displayed as just A).

Examples:
LLLLLL - 6 Letters [A-Z] are 'required'
AAAAAA - 6 Letters or Digits are 'required'
NOTE: Select the Input Mask Field for a Field in Table Design View on the bottom Pane and press F1
Jan 24 '07 #1
1 10633
missinglinq
3,532 Recognized Expert Specialist
A good point to remember when using input masks is that the user may not always arrive at the control by tabbing to it from the previous control, but may click on the control. If a mask is being used and the user doesn't click to insert the cursor at the very beginning of the text box, he/she may start to enter data without realizing that they're not at the beginning. When they leave the control they'll get an error message because the data wasn't entered as the input mask dictated. They'll then have to go back and re-enter the info. The way to avoid this is to use something like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourControlName_Click()
  2.     YourControlName.SelStart = 0
  3. End Sub
Even tabbing to the control can be problematic if in the Options for the database the default behavior for "Entering Field" is set to anything other than "Go to start of field." The answer to this is to set the cursor to the beginning of the field:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourControlName_GotFocus()
  2.     YourControlName.SelLength = 0
  3. End Sub
May 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
12721
by: dude | last post by:
hello how would i make an input mask that only makes the first letter a capitol one? i've been playing around and testing various masks, also tried the wizard, but i've had no luck. could anyone help, many thanks in advance.
2
3075
by: Mark Lees | last post by:
I want to create an input mask for a phone number and I would like the area code to always be (801). However, I want the users to be able to edit it if necessary. Would it look like this = !"(801) 000\-0000;;_" ?
4
3063
by: David W. Fenton | last post by:
I'm working on a subform where users put in 24-hour time. On their paper forms, they've been accustomed to referring to midnight as 24:00 (instead of as 0:00, which kind of makes sense from a human point of view, though it's still wrong, as it puts midnight as the end of the previous day instead of the beginning of the next, but it avoids the zero time problem). I have an input mask to put the : in the time, but when you input 24:00, it...
7
7084
by: F. Michael Miller | last post by:
I have a db with Access front end, sql back, linked tables. I need to be able to change input masks at the table level in code. Any ideas? Thanks!
6
6009
by: Regnab | last post by:
Morning All, I'm trying to ensure that when the user enters a number on a form, the database automatically leaves a space after the 3rd number. I've tried to do this using input masks, but when I tab to the text box, the ___ _____ shows up and I can't enter anything at all. Cheers Reg
2
2017
by: BerkshireGuy | last post by:
Is there a way to display what the expected format is before entering a control. For instance, if I have the input mask of 99/99/0000;0;#, it shows me ##/##/##, but only when I type the first character. Is there a way to have that display before I type anything?
16
12709
by: Filips Benoit | last post by:
Dear all, I have a datefield that sometimes should store hours and minutes too ans use following format and inputmask. dd/mm/yyyy hh\:nn 09/09/0000\ 99:99;0;* Typing date, hour and minutes is OK.
4
4981
by: Dave | last post by:
Hello - Say I have a 32 bit value in data (v:4, r:4, l:8, p:16) unsigned char data; Now, for portabilities sake, I want to use shifts and masks to access these fields, instead of accessing the bitfields directly. Lets assume v has a value of 2. To view the value of v in data, I need
12
3197
by: panjap | last post by:
a few days a go i was kindly helped with the trouble i was having on editing lables wjhere i wanted to change access' messages to my own. Below si the qeustion i set a few days agoa , which worked brillintantly with the answer posted below If I follow your logic correctly, you wish to replace the Standard Acces Error message with a custom one of you choice and not display the generic one from Access. To accomplish this, you must place...
5
9860
by: ezechiel | last post by:
hi everyone.. i read on another forum that it is possible to define multiple input masks for a textbox (for example). There is a textbox field where you can enter the name of a machine. The user should only have two possibilities: HOSTx-xxx vba: HOST9-99C ? like HOST2-45 or HOST9-245 (C can be 'nothing', right or not?)
0
10037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9879
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11055
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10541
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5939
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3360
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.