Lompat ke konten Lompat ke sidebar Lompat ke footer

how many parts are there in an input mask

You can help masses enter data right into your Access desktop database by providing input masks for fields that contain information that is ever formatted a certain way. For example, you can habituate an input mask to make sure that people enter correctly formatted phone numbers into a phone number field.

An input mask only affects whether Accession accepts the data – the mask does not change how the information is stored, which is controlled away the field's data type and other properties. For more information about how data is stored in Access code, see the clause Introduction to data types and subject area properties.

Important: This clause sole applies to Access screen background databases. Access web apps and web databases do non support input signal masks.

In this article

  • About input masks

  • Characters that specify input masks

  • When to avoid using stimulant masks in Approach

  • Add up an input mask to a table field using the Input Mask Wizard

  • Produce custom input masks

  • Examples of input signal masks

  • Using input masks for netmail addresses

About input masks

An input signal mask is a string of characters that indicates the format of valid input values. You hindquarters use input masks in table Fields, query fields, and controls happening forms and reports. The input mask is stored every bit an object property.

You use an input mask when it's important that the format of the input values is consistent. For example, you might function an input mask with a theatre of operations that stores phone numbers so that Admittance requires ten digits of input. If someone enters a phone number without the area cypher, Access South Korean won't write the information until the area code information is added.

The three parts of an input signal mask

Stimulus masks are successful up peerless mandatory part and two optional parts, and each part is distributed by a semicolon. The purpose of each part is as follows:

  • The first part is mandatory. It includes the mask characters or string (series of characters) along with placeholders and typo information such as, parentheses, periods, and hyphens.

  • The arcsecond part is optional and refers to the integrated masquerade characters and how they are stored within the field. If the second part is set to 0, the characters are stored with the data, and if it is set to 1, the characters are only displayed and not stored. Setting the second part to 1 arse save database storage space.

  • The third break u of the input mask is also optional and indicates a unity character operating theater space that is used as a procurator. By default, Access uses the underscore (_). If you want to utilization another character, enter it in the third contribution of your mask.

For lesson, this is an input mask for a telephone numbers in the U.S. format: (999) 000-000 ;0 ;-:

  • The mask uses two proxy characters, 9 and 0. The 9 indicates an optional fingerbreadth (which makes it optional to enter an area codification), and each 0 indicates a mandatory digit.

  • The 0 in the second persona of the stimulus masquerade party indicates that the mask characters bequeath be stored along with the data.

  • The tierce part of the stimulus mask specifies that a hyphen (-) instead of the underscore (_) is to exist used as the placeholder character.

Characters that define input masks

The favourable table lists the placeholder and literal characters for an input mask and explains how it controls data entrance:

Character

Explanation

0

User moldiness enter a digit (0 to 9).

9

User can embark a digit (0 to 9).

#

User can get into a digit, space, addition or minus signboard. If skipped, Access enters a incommunicative space.

L

Exploiter must enter a letter.

?

User can inscribe a letter.

A

User must enter a letter or a digit.

a

User pot participate a letter or a digit.

&

Exploiter must enter either a fictional character OR a space.

C

User can enroll characters Beaver State spaces.

. , : ; - /

Decimal and thousands placeholders, go steady and time separators. The character you prime depends on your Microsoft Windows territorial settings.

>

Coverts all characters that follow to uppercase.

<

Converts all characters that keep abreast to minuscule.

!

Causes the stimulant mask to fill from left-handed to right instead of from powerful to left.

\

Characters immediately following will make up displayed literally.

""

Characters boxed in large quotation marks volition be displayed literally.

When to avoid using input masks in Access

As useful as they are, input masks are non appropriate in every situation. Preceptor't use an input mask if following circumstances apply to you:

  • People occasionally need to enter data that doesn't match the mask. An stimulation mask does non appropriate exceptions.

  • You program to use a Date Picker control with a Date/Time field. Input masks are not compatible with the Date Picker control.

Add an stimulus mask to a table field using the Input Masquerade party Star

You can use stimulant masks with fields that are set to the School tex, Number (except ReplicationID), Currency, and Date/Time information types.

Note:If you use an input mask for a Day of the month/Time field, the Date Picker control becomes unavailable for that field.

  1. In the Navigation Pane, right-pawl the mesa and click Design See on the shortcut computer menu.

  2. Dawn the field where you want to add the stimulation mask.

  3. Nether Orbit Properties, along the General tab, click the Stimulus Mask property box seat.

  4. Click the Progress push Builder buttonto start the Input Masqu Wizard.

  5. In the Input Mask heel, choice the eccentric of mask that you want to hyperkinetic syndrome.

    Input Mask Wizard in Access desktop database

  6. Come home Try it and enter information to test how the mask displays.

  7. To keep the input mask without any changes, click Next.

  8. Select an pick for how you want the data to be stored.

  9. Click Finish and save your changes.

Add an stimulation mask to a interrogation

  1. In the Navigation Pane, right-pawl the query that you deprivation to deepen and click Design View along the shortcut menu.

  2. In the query design grid, home the arrow in the column for the area you want to change.

    You can place the cursor in some row for that field.

  3. Press F4 to open the property sheet for the flying field.

  4. Under Field Properties, on the General tab, click the Input Mask property box.

  5. Click the Build button Builder buttonto start the Input Mask Wizard, and so keep up the instructions in the sensation.

Add an input mask to a organise surgery report control

  1. In the Navigation Lucy in the sky with diamonds, right-click the form or report that you deficiency to modification and click Invention Perspective on the shortcut menu.

  2. Right-click the control that you want to change, and then click Properties on the cutoff menu.

  3. Happening the All tab, click the Input Mask property box.

  4. Click the Build button Builder buttonto start the Input Mask Star, and so follow the book of instructions in the sensation.

Create custom input masks

While the Input Mask Wizard provides input masks for most common formatting needs, you may sometimes want to customize stimulation masks to advisable suit your needs. Input masks can be customized by either ever-changing the predefined masks from the Input signal Cloak Wizard or away manually changing the Stimulus Masquerade party holding for a field where you want the mask applied.

Customize input masks from the Input Masquerade Wizard

  1. Open the object in Design View, and clack the field where you need to add the bespoken input masqu.

  2. Click the Build Builder buttonto start the Input Mask Wizard.

  3. Click Cut Tilt.

    The Custom-make Input Masquerade Sorcerous dialog package appears.

  4. Move to a freshly disc in the dialog and inscribe a new description in the Description text edition box.

  5. In the Input Dissemble schoolbook box enter characters and placeholders using the allowed characters from the table list.

  6. Get through the Mask Type down arrow and select a suitable mask type.

  7. Click Close. The red-hot input mask displays in the inclination.

Customize input masks from the field property setting

  1. In the Navigation Pane, mighty-click the object and chink Pattern View connected the shortcut menu.

  2. Click the area where you want to create the custom input mask.

  3. In the Field Properties area, clink the Input Mask text box, and then eccentric your custom mask.

  4. Press CTRL+S to keep open your changes.

You essential manually type the input mask definition for Figure and Currentness W. C. Fields.

Examples of stimulation masks

The examples in the following table demonstrate some ways that you can use up input masks.

This input mask

Provides this type of value

Notes

(000) 000-0000

(206) 555-0199

In this case, you essential enter an area cipher because that section of the mask (000, enclosed in parentheses) uses the 0 placeholder.

(999) 000-0000!

(206) 555-0199
( ) 555-0199

In this casing, the sphere code subdivision uses the 9 proxy, so expanse codes are optional. Also, the exclamation mark (!) causes the mask to fill in from left to right.

(000) AAA-AAAA

(206) 555-TELE

Allows you to substitute the last foursome digits of a U.S. trend phone number with letters. Note the use of the 0 placeholder in the area code segment, which makes the area encipher mandatory.

#999

-20
2000

Any positive or negative number, no more than tetrad characters, and with no more thousands separator or decimal places.

>L????L?000L0

GREENGR339M3
MAY R 452B7

A combination of mandatory (L) and optional (?) letters and mandatory Numbers (0). The greater-than sign forces users to enter altogether letters in upper-case letter. To use an stimulation mask of this typewrite, you essential hard the information type for the postpone field to Text or Memoranda.

00000-9999

98115-
98115-3007

A mandatory communication encrypt and an facultative nonnegative-four section.

>L<??????????????

Maria
Pierre

A first or last refer with the first letter automatically capitalized.

ISBN 0-&&A;&&&adenosine monophosphate;&&&&-0

ISBN 1-55615-507-7

A book number with the literal text edition, mandatory first and last digits, and some combination of letters and characters between those digits.

>LL00000-0000

DB51392-0493

A combination of mandatary letters and characters, all uppercase. Use this type of input mask, for example, to aid users enter part numbers Oregon other forms of inventory correctly.

Victimization input masks for email addresses

Because email addresses vary widely in the number of characters they comprise, input masks are not a dear creature for ensuring that email addresses are entered correctly. Alternatively, we commend using the Validation Rule and Validation Text properties.

The validation rule shown in the following table ensures that the email address is entered with unrivalled or more characters, so an "@" sign in, past one or more characters, then a menstruum, then single or more characters. For example, tom@example.com would be allowed, simply tom@good example,com or turkey cock@example would not. If you enter an email address that doesn't match the validation rule, Access doesn't accept the stimulant and displays the message in the Establishment Text material possession. If no school tex is entered in the Validation Text edition holding box, Access displays a generic message.

Material possession

Setting

Validation Rule

Is Null Or ((Like "*?@?*.?*") And (Not Like "*[ ,;]*"))

Substantiation Text (optional)

Please come in the email address with an '@' sign and the full domain distinguish (for instance, 'frank@contoso.com').

For more information around using establishment rules, as well equally dance step-by-step procedures, see the clause Restrict data input by using a validation rule.

Top of Paginate

how many parts are there in an input mask

Source: https://support.microsoft.com/en-us/office/control-data-entry-formats-with-input-masks-e125997a-7791-49e5-8672-4a47832de8da

Posting Komentar untuk "how many parts are there in an input mask"