×
英语
很抱歉。本文没有你的语言版本。

Add an AutoNumber field as a primary key

Note: When you create a new table in Datasheet view, Access automatically creates a primary key for you and assigns it the AutoNumber data type.

  1. In Access, open the database that you want to modify.

  2. In the Navigation Pane, right-click the table to which you want to add the primary key, and click Design View.

    Tip: If you don't see the Navigation Pane, press F11 to display it.

  3. Locate the first available empty row in the table design grid.

  4. In the Field Name field, type a name, such as CustomerID

  5. In the Data Type field, click the drop-down arrow and click AutoNumber.

  6. Under Field Properties, in New Values, click Increment to use incrementing numeric values for the primary key, or click Random to use random numbers.

When you create a new table in Datasheet view, Access automatically creates a primary key for you and assigns it the AutoNumber data type.

扩展你的 Office 技能
了解培训
抢先获得新功能
加入 Office 预览体验计划

此信息是否有帮助?

谢谢您的反馈!

谢谢你的反馈! 可能需要转接到 Office 支持专员。

×