MIS 134 To Database: (Table Properties)
MIS 134 To Database: (Table Properties)
(Table Properties)
Birgl Kutlu
FIELD PROPERTIES
Field Size is used to set the number of characters needed in a text or number field. The default field size for the text type is 50 characters. If the records in the field will only have two or three characters, you can change the size of the field to save disk space or prevent entry errors by limiting the number of characters allowed. Likewise, if the field will require more than 50 characters, enter a number up to 255. The field size is set in exact characters for Text type, but options are give for numbers:
Byte - Positive integers between 0 and 255 Integer - Positive and negative integers between -32,768 and 32,767 Long Integer (default) - Larger positive and negative integers between -2 billion and 2 billion. Single - Single-precision floating-point number Double - Double-precision floating-point number Decimal - Allows for Precision and Scale property control
FIELD PROPERTIES
Format conforms the data in the field to the same format when it is entered into the datasheet. For text and memo fields, this property has two parts that are separated by a semicolon. The first part of the property is used to apply to the field and the second applies to empty fields.
<
>
HELLO
hello
hello
HELLO
NUMBER FORMAT
Format Datasheet Entry Display Explanation
###,##0.00
123456.78
$###,##0.00 0
###.00%
.123
123,456.78 0 is a placeholder that displays a digit or 0 if there is none. $0.00 # is a placeholder that displays a digit or nothing if there is none. 12.3% % multiplies the number by 100 and added a percent sign
CURRENCY FORMAT
This formatting consists of four parts: format for positive numbers; format for negative numbers; format for zero values; format for Null values.
Explanation Positive values will be normal currency format negative numbers will be red in parentheses
$0.00;
"none"
DATE FORMAT
Format
dddd","mmmm d","yyyy
h:n:s: AM/PM
YES/NO FORMAT
Yes/No fields are displayed as check boxes by default on the datasheet. To change the formatting of these fields, first click the Lookup tab and change the Display Control to a text box. Go back to the General tab choices to make formatting changes. The formatting is designated in three sections separated by semicolons. The first section does not contain anything but the semicolon must be included. The second section specifies formatting for Yes values and the third for No values.
Format Explanation
;"Yes"[green] ;"No"[red]
DEFAULT VALUE
There may be cases where the value of a field will usually be the same for all records. In this case, a changeable default value can be set to prevent typing the same thing numerous times.
PRIMARY KEY
Every record in a table must have a primary key that differentiates it from every other record in the table. In some cases, it is only necessary to designate an existing field as the primary key if you are certain that every record in the table will have a different value for that particular field. A social security number is an example of a record whose values will only appear once in a database table. Designate the primary key field by right-clicking on the record and selection Primary Key from the shortcut menu or select Edit|Primary Key from the menu bar. The primary key field will be noted with a key image to the left. To remove a primary key, repeat one of these steps.
PRIMARY KEY
If none of the existing fields in the table will produce unique values for every record, a separate field must be added. Access will prompt you to create this type of field at the beginning of the table the first time you save the table and a primary key field has not been assigned. The field is named "ID" and the data type is "autonumber". Since this extra field serves no purpose to you as the user, the autonumber type automatically updates whenever a record is added so there is no extra work on your part. You may also choose to hide this column.
INDEXES
Creating indexes allows Access to query and sort records faster. To set an indexed field, select a field that is commonly searched and change the Indexed property to Yes (Duplicates OK) if multiple entries of the same data value are allowed or Yes (No Duplicates) to prevent duplicates.
VALIDATION RULES
Validation Rules specify requirements (change word) for the data entered in the worksheet. A customized message can be displayed to the user when data that violates the rule setting is entered. Click the expression builder ("...") button at the end of the Validation Rule box to write the validation rule. Examples of field validation rules include <> 0 to not allow zero values in the record, and ??? to only all data strings three characters in length.
VALIDATION RULES
Symbol
>100 <>0 Like [A-K]*
Explanation
Value has to be greater than 100 0 value can not be entered Value has to start with character AK.
Like A??
Between 10 and 40
Value has to start with A and has to be 3 letters. Value has to be between 10 and 40 Date value must be between January 1, 1998 and December 31, 1998.
INPUT MASK
An input mask controls the value of a record and sets it in a specific format. They are similar to the Format property, but instead display the format on the datasheet before the data is entered. For example, a telephone number field can formatted with an input mask to accept ten digits that are automatically formatted as "(555) 1234567". The blank field would look like (___) ___-____. An an input mask to a field by following these steps: In design view, place the cursor in the field that the input mask will be applied to. Click in the white space following Input Mask under the General tab. Click the "..." button to use the wizard or enter the mask, (@@@) @@@-@@@@, into the field provided.
0
9 # ?;L C or & <;>
A digit 0 through 9 without a + or - sign and with blanks displayed as zeros Same as 0 with blanks displayed as spaces
Same as 9 with +/- signs Letter A through Z; same as ? but must be entered Character or space
Convert letters to lower case ; Convert letters to upper case PASSWORD Instead of the character * is displayed.
To create a form using the assistance of the wizard, follow these steps: Click the Create form by using wizard option on the database window.
On the second screen, select the layout of the form. Columnar - A single record is displayed at one time with labels and form fields listed side-by-side in columns Justified - A single record is displayed with labels and form fields are listed across the screen Tabular - Multiple records are listed on the page at a time with fields in columns and records in rows Datasheet - Multiple records are displayed in Datasheet View Click the Next > button to move on to the next screen.
Select a visual style for the form from the next set of options and click Next >.
On the final screen, name the form in the space provided. Select "Open the form to view or enter information" to open the form in Form View or "Modify the form's design" to open it in Design View. Click Finish to create the form.