Change a column’s identity properties (ADP)

Microsoft Office Access 2003

Show All Show All

Change a column’s identity properties (ADP)

Note  The information in this topic applies only to a Microsoft Access project (.adp).

  1. In the Database window, click Database Diagrams Button image under Objects, click the database diagram you want to open, and then click Design on the Database window toolbar.
  2. In your database diagram, select the table in which you want to change the identity properties of a column.
  3. If necessary, right-click the table and select Custom View from the shortcut menu.
  4. Make sure the Identity, Identity Seed, and Identity Increment properties are visible.

    ShowHow?

    ShowBackground information

    When you are working with only a few tables in a database diagram, it is usually helpful to view as much column information as possible. Such a view not only gives you more information, but it also enables you to edit the column definitions.

    When you are working with a large number of tables, however, it is usually preferable to view only the column names, or only the table name, so that you can see more of the tables in your diagram at once.

    In a database diagram, you can expand the tables you want to edit as needed and then collapse them again to save space on the diagram.

    Each table in a database diagram can be displayed in one of five views.

    Database diagram

    • Column Properties Button image Shows every database column of the table, but shows only the column name and other fundamental properties of each database column. You can edit the column properties directly by typing in a cell or using the Cut, Copy, and Paste commands. You can also move and delete entire database column definitions.

      When you insert a new table into a database diagram, it is shown in this view so that you can begin defining each column.

    • Column Names Button image Shows only the name of each database column. You can rename the database columns in this view. When you add an existing table to a diagram, it is shown in this view.
    • Keys Button image Shows only the names of only some of the table’s columns. The columns whose names appear are those participating in a primary key, a foreign key, or a unique constraint. You can rename some of the database columns in this view.
    • Name Only Button image Shows only the table name.
    • Custom Button image Shows all of the table’s database columns, but shows only the properties you choose. This gives you the flexibility to display only the information you want. This view is also useful for printing the database diagrams, because you can display more tables on one page, and will not normally see horizontal scroll bars on the tables.

      The default set of properties for the Custom view includes Column Name, Condensed Datatype, and Nullable.

    Property Setting
    Column Name The name of the field in the table.
    Condensed Type Information about the field's data type, in the same format as the SQL Create Table statement. For example, a field containing a variable-length string with a maximum length of 20 characters would be represented as varchar(20).
    Nullable Null (the field can contain a Null value) or Not Null (the field must contain a non-null value).

    ShowChange a table view

    1. In the Database window, click Database Diagrams Button image under Objects, click the database diagram you want to open, and then click Design on the Database window toolbar.
    2. In your database diagram, select the tables you want to see in another view. To change the view of all the tables in your diagram, choose Select All from the Edit menu.
    3. Right-click the table and select the desired view from the shortcut menu.

    When you finish editing a table, you can change it to a different view or resize it to create more space on the database diagram.

    ShowModify the Custom view

    1. In the Database window, click Database Diagrams Button image under Objects, click the database diagram you want to open, and then click Design on the Database window toolbar.
    2. In your database diagram, select the table you want to see in Custom view.
    3. Click the Diagram menu, and then click Modify Custom View. The Column Selection dialog box appears.
    4. Use the arrows to move the desired columns from the Available columns box to the Selected columns box.

      Note  To add a column, highlight the column in the Available columns box and click the > button. The column will then be listed in the Selected columns box. To display all columns, click the >> button. To remove a column from the Selected columns box, highlight the column and click the < button.

    5. The columns will appear in the table in the order they are displayed in the Selected columns box. Use the Sort arrows to rearrange the columns in the Selected columns box to the desired order.
    6. To make this setting the default Custom view, select the Save as default box.

      Note  If the Save as default box is not selected, the columns listed in the Selected columns box will be displayed for all the database tables displayed in Custom view on the current diagram. However, this setting will not be saved and is not applied to other diagrams when you choose the Custom view command.

    The selected table is redrawn to display the columns chosen in the dialog box.

  5. If the Allow Nulls property is selected, clear the check box.
  6. Select the Identity cell for the column whose values you want to automatically increment.

    Note  Only one column per table can be defined as an identity column.

  7. Type a value in the Identity Seed cell. This value will be assigned to the first row in the table. If you leave this cell blank, the value 1 will be assigned by default.
  8. Type a value in the Identity Increment cell. This value is the increment that will be added to the Identity Seed for each subsequent row. If you leave this cell blank, the value 1 will be assigned by default.