Art Exhibitions            Index           Links           Home             Feedback


Last                                                                   Next


Community tute 13 - Modifying field properties

1. Start Access and open the database we created in the last tute, select the 'Tables' tab and the 'Main Table' object then hit the 'Design' button. If you did not compete the last tute you can download the database click here to download.


2. Select the 'FirstName' field, and change the value of the 'Required' setting form 'No' to 'Yes'. This now means that the any new records entered must have an entry for this field (the field cannot be null).


3. Now select the 'Initial' field change the value for 'field size' from '50' to '1'. This means that now the user can only enter one character in this field.


4. Close the table, the following warning message indicates that if there are entries in the 'Initial' field that are longer than one character, the last three characters will be truncated.


5. Open the 'Main Table', look at the effect of changing the field size of the 'Initial' field, try typing extra data into that field. Only the first key stroke should be recorded.


6. Try adding an new record to the main table without entering anything into the 'FirstName' field, you should get the message displayed below. Press the 'Esc' key, and go back to the design view of the 'Main Table'.


7. Lets look at the input mask on the postcode field, the setting is '0000'. The table below shows what the '0' stands for, the interpretation for the field is as follows: this is not a required field (required = no), when the user does enter a value into the field it must contain 4 digits, each of which must be a number between 0-9. If the post office decided to put a letter prefix before the four digit number ie f1902, f1903 etc the input mask would look like '\f000', feel free to try it!


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).

Note:

Setting the InputMask property to the word "Password" creates a password-entry control. Any character typed in the control is stored as the character but is displayed as an asterisk (*). You use the Password input mask to prevent displaying the typed characters on the screen.


8. Back to the design view of the table again, set the default value of the 'JoinDate' field to the current system date, by typing '=now()' in against the 'Default Value' setting. If you were setting the value of a text field or number field you would just type the default string you wanted in the same box.


9. Look at the effect, the current system date and time is added as the default when a new record is added.





Copyright © 1999 R&D Robotics Pty Ltd, All rights reserved.
Any copyright subsisting in the above code and or literary works including source files vests with R&D Robotics Pty Ltd. ACN 086 345 137



Last                                                                   Next