Lesson SummaryUnderstanding Field PropertiesTo Display a Table in Design View: Open the table and click the View button on the toolbar, or, in the Database window, click the Tables icon in the Objects bar, select the table, and click the Design button. Indexing a FieldTo Index a Field: Display the table in Design view. Click the field you want as an index, click the Indexed box, click the list arrow, and select one of the following: Yes (Duplicates OK) if you want to allow multiple records to have the same data in the field, or select Yes (No Duplicates) if you want to ensure that no two records have the same data in the field. Adding a Primary Key to a TableTo Add a Primary Key to a Table: Display the table in Design view and click the field that you want to set as the primary key. If such a field doesn't exist, you will have to create it. Click the Primary Key button on the toolbar or right-click the field you want to use as the primary key and select Primary Key from the shortcut menu. Inserting, Deleting, and Reordering FieldsTo Insert a Row: Click the row selector for the field that will be below the new field you want to insert and press Insert. To Change the Order of Fields in a Table: Click the row selector for the field you want to move and click and drag the selected row to the desired location. To Delete a Field from a Table: Click the row selector for the field and press Delete. Changing a Field's Data TypeTo Change the Data Type for a Field: Display the table in Design view, click the field's Data Type box, click the list arrow, and select the data type. Using Field DescriptionsTo Add a Description to a Field: Display the table in Design view, click the field's Description box, and type the description. Adding a CaptionTo Add a Caption to a Field: Display the table in Design view, click the field you want to add a caption to, click the Caption box in the Field Properties section, and type the caption. Changing the Field SizeTo Change the Field Size: Display the table in Design view, click the field whose size you want to change, click the Field Size box in the Field Properties section, and either type the Field Size value (for text fields) or choose the value from the list (for number fields). Formatting Number, Currency, and Date/Time FieldsTo Format Number and Currency Fields: Display the table in Design view, click the field you want to format, click the Format box in the Field Properties section, click the list arrow, and select a number format. To Change the Number of Decimal Places: Display the table in Design view, click the field you want to format, click the Decimal Places box in the Field Properties section, click the list arrow, and select the number of decimal places you want to display. Formatting Number, Currency, and Date/Time Fields by HandTo Manually Format a Date/Time, Number, or Currency Field: Display the table in Design view, click the field you want to format, click the Format box in the Field Properties section, and enter the appropriate formatting characters or symbols. Formatting Text FieldsTo Manually Format a Text Field: Display the table in Design view, click the text field you want to format, click the Format box in the Field Properties section, and enter the appropriate text formatting symbols. Setting a Default ValueTo Enter a Default Value for a Field: Display the table in Design view, click the field you want to add a default value to, click the Default Value box in the Field Properties section, and enter the default value you want to appear in the field for new records. Requiring Data EntryTo Require Data Entry for a Field: Display the table in Design view, click the field you want to require data entry for, click the Required box in the Field Properties section, click the list arrow, and select Yes. Validating DataTo Validate Field Data: Display the table in Design view, click the field you want to apply a validation rule to, click the Validation Rule box in the Field Properties section, and enter an expression you want to use to validate the field's data. Next, click the Validation Text box in the Field Properties section and type the text that Access will display when the user tries to enter incorrect data for the field. Creating an Input MaskTo Create an Input Mask for a Field: Display the table in Design view, click the field you want to create an input mask for, and click the Input Mask box in the Field Properties section. Click the Build button to start the Input Wizard, then either select an input mask from the predefined list or manually create the input mask by entering the appropriate characters. Creating a Lookup FieldTo Create a Lookup Field: Display the table in Design view, click the field's Data Type box, click the list arrow, and select Lookup Wizard. Click the I want the lookup column to look up the values in a table or query option, click Next, then select the table or query you want to use for the look up list and click Next. Select the fields you want to add to the lookup field and click Next. Select a sort order for your list (optional) and click Next. Adjust the width of the columns that will appear in the lookup list and indicate whether or not to include the primary key in the list. If the table or query doesn't have a primary key, you will be prompted for the column that will act as the bound column. Click Next. Enter a label for the Lookup column, and click Finish. Creating a Value ListTo Create a Value List: Display the table in Design view, click the field's Data Type box, click the list arrow, and select Lookup Wizard. Click the I will type in the values that I want option and click Next. Specify the number of columns you want to appear in the value list, then enter the values in the list. Resize the column widths, if necessary, and click Next when you're finished. Enter a label for the Lookup column and click Finish. Modifying a Lookup ListTo Modify a Lookup List: Display the table in Design view, click the lookup list's field name box, then click the Lookup tab in the Field Properties section. Click the Row Source button to display the SQL Statement: Query Builder window, make the desired changes, and then close the SQL Statement: Query Builder window. Quiz
Homework
Quiz Answers
|