Sie sind auf Seite 1von 4

Access 2013 – Advanced Field Properties : Lookups and Masks

Introduction The placeholder is the character that appears by default when 6. Save the changes and close Design View.
entering data in the field, indicating where to type. Custom input mask
Input masks control how data is entered into a table, as well as the 10. Enter values to test the final version of your input mask and
format in which it is stored. You can use an input mask to control If you frequently use the same input mask in many different tables
then click Next to continue. and databases, you may want to create a custom input mask.
how many characters are entered into a field; define each
11. Indicate which method to store the data. You can create and save a custom input mask in the Input Mask
individual character as numeric, text, or either; and specify each
12. Click the Finish button. Wizard, where it is available to tables and forms at any time. In this
individual character as mandatory or optional, as well as add
literal characters to format the entry. Since the input mask Entering manually way, you will only need to create a custom input mask once.
controls the values users can enter into a field, it often makes data You can create an input mask by typing the relevant characters and 1. In the Navigation Pane, right click the table that you want to add
entry easier. symbols directly into the Input Mask property for a field. an input mask to.
The following table defines some of the special characters that can 2. Select Design View.
Creating an Input Mask
be used for an input mask. To define a literal character, enter any 3. Select the field you want an input mask for.
Using the ‘Wizard’ character other than one of those shown in the table. If you want 4. In the Field Properties pane, click in the Input Mask box.
The Input Mask Wizard offers several predefined input masks for to define a character listed in the table as a literal character, you
5. Click the Build button .
items such as Post codes, telephone numbers, dates and times. In must precede that character with a backslash (\).
addition, you can modify any predefined input mask to meet your Character Allows entry of… 6. Click the Edit List button .
needs. 0 A required numeric entry (0-9); plus and minus
1. In the Navigation Pane, right click the table that you want to signs are not allowed 7. Click the New button in the Navigation Bar at bottom of
add an input mask to. dialog box.
9 An optional numeric entry (0-9) or space; plus and
2. Select Design View. minus signs not allowed
3. Select the field you want an input mask for. # An optional numeric (0-9) entry or space; plus and
4. In the Field Properties pane, click in the Input Mask box. minus signs allowed
5. Click the Build button . L A required alphabetic entry (A-Z)
6. Select the desired option from the Input Mask list. ? An optional alphabetic entry (A-Z)
A A required alphabetic (A-Z) or numeric (0-9) entry
a An optional alphabetic (A-Z) or numeric (0-9) entry
& Any character or space; entry required 8. Type the desired description for the custom input mask.
C Any character or space; entry optional 9. Click in the Input Mask: box.
< Causes all characters that follow to be converted to 10. Type the custom input mask (see table above).
lowercase 11. Click in the Placeholder: box.
< Causes all characters that follow to be converted to 12. Type the placeholder you want.
uppercase
13. Click in the Sample Data: box.
! Enters the input mask from right to left, instead of
14. Type some sample data to check it works correctly.
from left to right
15. Click in the Mask Type: box and select accordingly.
\ Causes the character that follows to be displayed as
16. Click the Close button.
a literal character
7. Click Next to continue. 17. In the Input Mask list, select the custom input mask just created.
1. In the Navigation Pane, right click the table that you want to
8. If you want to edit the mask, use the table below (under add an input mask to. 18. Click Finish.
Entering manually) to identify other characters to use in the 2. Select Design View. 19. Save the changes and close Design View.
Input Mask box. Tip: To delete custom masks, navigate to (Win7):
3. Select the field you want an input mask for.
9. If you want to display a different placeholder, click the Users\ <username>\AppData\Roaming\Microsoft\Access and delete
4. In the Field Properties pane, click in the Input Mask box.
Placeholder list arrow, and select the placeholder you want. the file named ACWZUSR12.ACCDU.
5. Type the desired input mask (refer to the table above).

1 of 4
Access 2013 – Advanced Field Properties : Lookups and Masks
Creating a Lookup Using the Lookup Wizard 16. Tick the Allow Multiple Values check box, if required.
17. Click the Finish button.
You can increase data accuracy by adding a lookup field to a table.
18. Save the changes and close Design View.
The user can then select the desired value from the lookup list,
rather than having to type it. The values in a lookup list are usually NB. If you select Allow Multiple Values, you cannot later change this
stored in a field in a different table. If the desired data is not setting. Allowing a lookup to accept multiple values also sets the Limit
stored in a table, you can type the lookup list values manually. to List option to TRUE and disables the check box.

Creating a lookup using another table or query


7. Enter the desired number of lookup columns.
1. In the Navigation Pane, right click the table that you want to add
8. Select the box below the Col1 heading.
Single value lookup Multiple value lookup an input mask to.
9. Type the first desired lookup value.
A lookup list can also contain multiple columns. If you are typing a 2. Select Design View.
10. Enter additional lookup values as desired.
new list of values, you can designate the number of columns 3. Click the Data Type drop down list for the field you want to create
desired and then type the desired values into each column or, use 11. Click the Next button.
a lookup for.
a multiple field table as the source.
4. Select Lookup Wizard….
5. Select the I want the lookup field to get the values from another
table or query option.

Multiple column lookups


Creating a lookup with typed-in values
1. In the Navigation Pane, right click the table that you want to
add an input mask to.
2. Select Design View. 12. Select the column that contains the values you want to store or
3. Click the Data Type drop down list for the field you want to use (this will usually be Col1).
create a lookup for. 13. Click the Next button.
4. Select Lookup Wizard….
6. Click the Next button.
7. Select the table or query containing the values for the lookup.

14. Accept or change the Label (field name).


5. Select the I will type in the values that I want option. 15. Tick the Limit to List check box if you wish to restrain data entry
6. Click the Next button. to items in the list only.
8. Click Next.

2 of 4
Access 2013 – Advanced Field Properties : Lookups and Masks
9. Select the first field that you want to display in the lookup. If, however, the lookup was created by getting values from a table or
query, you can only modify the list in table Design View (see below).
10. Click the button.
Modifying a lookup created from a table or query
11. Select additional fields as described in 9 & 10 above.
1. Open the required table in Design view.
2. Select the field whose lookup list is to be modified.
3. In the Field Properties pane, select the Lookup tab.
4. Select the property you want to modify (refer to the table below
or press F1 for Help).
5. Change the property as required (refer to the table below or
press F1 for Help).
18. Click Next.
6. Save the changes and close Design view.
19. Accept or change the Label (field name).
There should be no need to edit the Display Control and row source
20. Tick the Enable Data Integrity check box. This helps prevent type property. Other properties are as follows:
inaccurate data entry.
12. Click Next. Property Description
21. Tick the Allow Multiple Values check box, if required.
13. Select the sort order for the lookup. Row Source The SQL statement that extracts data from
a table or query to populate the lookup.
Edit this property by clicking the Build
button at the right of the property box.
In some cases, this may just be a table or
query name in which case, select a different
table or query by clicking the down-arrow
at the right of the property box.
Bound Column The property indicates which lookup
column is used to store field values. For
instance, if the lookup list consists of two
22. Click the Finish button. columns, and column 1 is the bound
14. Click the Next button. 23. Click Yes to the message about creating relationships column, the data in column 1 will be stored
15. Adjust the width of the columns by clicking and dragging the 24. Save the changes and close Design View. in the lookup field.
grey column separators at the top of the grid. Column Count Specifies the number of columns to show in
NB. If you specify a lookup to Allow Multiple Values, this setting
cannot later be changed. the lookup list
Column Heads Displays a row at the top of the lookup list
giving names for the columns
Column Widths The width of each column in a multiple
column list.
Modifying a Lookup List Rows Maximum number of rows displayed in the
list before a scroll bar is displayed
You can use the Modify
List Width The width of the entire list
Lookups command on the
Fields tab under Table Limit to List Field only accepts items in list
Tools to modify the Allow Multiple User can select more than one item in the
16. Click the Next button.
values displayed in a Values list. This produced a list with check boxes
17. Select the column that contains the values you want to store
lookup list (see page 4). next to each item and multiple entries are
or use (this will usually be the ID field).

3 of 4
Access 2013 – Advanced Field Properties : Lookups and Masks
shown in data cell separated by commas.
Allow Value List Allows editing of the listed items
Edits
List Items Edit form Specifies which form to open to edit list
items
Show Only Row List only shows items that match the row
Source Values source property

Modifying a lookup created from typed-in values


1. Open the table containing the lookup field that you want to
modify. 9. Accept or change the Label (field name).
2. Click in the field (column) that you want to modify. 10. Tick the Limit to List check box if you wish to restrain data entry
3. Select the Fields tab under Table Tools. to items in the list only.
4. Click the Modify Lookups command in the Properties group. 11. Tick the Allow Multiple Values check box, if required.
5. Edit the values list by adding, removing or editing text, rows or 12. Click the Finish button.
columns and adjusting column widths. 13. Save, close and re-open the table for the changes to take effect.
Removing a lookup from a field
To remove a lookup from a field, you change the field’s Display
Control, property to Text Box.
1. Open the required table in Design view.
2. Select the field whose lookup list is to be modified.
3. In the Field Properties pane, select the Lookup tab.
4. Click in the Display Control property box.
5. Select Text Box from the drop-down list.
6. Save and close Design View.
6. Click the Next button.

7. Select the column that contains the values you want to store
or use (this will usually be Col1).
8. Click the Next button.

4 of 4

Das könnte Ihnen auch gefallen