en uk

Adding and deleting a field Microsoft Access 2007

    Sometimes you may need to add a field to make room to store new informa­tion. Other times, you may want to delete a field that you don't really want after all. To add a field to a database table, follow these steps:

    1. Click an existing field in your database table.

    2. Click the Datasheet tab.

    3. Click the Insert button in the Fields & Columns group.

    Access inserts a new field (column) in your database table.

    To delete a field from a database table, follow these steps:

    1. Click the field you want to delete.

    Access highlights the entire column in your database table.

    2. Click the Datasheet tab.

    3. Click the Delete button in the Fields & Columns group.

    A dialog box appears, asking whether you want to permanently delete all the data in the field, as shown in Figure 16-5.

    If you delete a field, you also delete any data that may be stored in that field. Depending on how much data you have stored, you could wipe out a lot of information by deleting a single field, so be careful.

    Adding and deleting a field Microsoft Access 2007

    Figure 16-5:

    Deleting a field also deletes any data in that field.

    4. Click Yes (or No).

    If you click Yes, Access deletes your chosen field.

    Defining the type and size of a field

    The type of a field defines the type of data the field can hold (numbers, text, dates, and so on), and the size of a field defines the amount of data the field can hold (no numbers larger than 250 digits, any text string fewer than 120 characters, and so on).

    The purpose of defining the type and size of a field is to make sure you store only valid data in a particular field. If a field is meant to store names, you don't want someone typing in a number. If a field is meant to store a person's age, you don't want the field to accept negative numbers.

    To define the type and amount of a data a field can store, follow these steps:

    1. Click the Home or Datasheet tab.

    2. In the All Tables pane on the left of the screen, double-click the table that contains the fields you want to define.

    Access displays the Datasheet view of your table.

    3. Click the downward-pointing arrow underneath the View icon, which appears in the Views group.

    A pull-down menu appears.

    4. Click Design View.

    Access displays the Design view of your database table, as shown in Figure 16-6.

    5. (Optional) Click in the Field Name column and edit an existing field name.

    If you click in a blank row, you can add a field to a database table.

    6. Click in the Data Type column.

    A downward-pointing arrow appears.

    Adding and deleting a field Microsoft Access 2007

    Figure 16-6:

    Design view lets you specify the size and type of data a field can hold.

    7. Click the downward-pointing arrow.

    A pull-down menu appears, listing all the different types of data you can define to store in a field, as shown in Figure 16-7.

    Adding and deleting a field Microsoft Access 2007

    Figure 16-7:

    You can choose a specific data type to make sure a field stores the correct information.

    8. Choose a data type, such as Number, Text, or Date/Time.

    Access displays a General tab that contains different options for modify­ing your chosen data type, as shown in Figure 16-8.

    Adding and deleting a field Microsoft Access 2007

    Figure 16-8:

    The General tab displays options for modifying your data

    Type.

    9. Click one of the data type options, such as Format or Input Mask, listed under the General tab.

    Sometimes you have to type a value directly into a data type option. Other times a pull-down menu appears, from which you can choose an option.

    10. Repeat Step 9 for each data type option you want to modify.

    You do not need to modify every data type option.




BACK NEXT TOP

Site is a private collection of materials and is an amateur informational and educational resource. All information is obtained from public sources. The administration does not apply for authorship of the materials used. All rights belong to their owners.