databasedev.co.uk - database solutions and downloads for microsoft access

Microsoft Access Table Design

Adding a prefix to an AutoNumber field in Microsoft Access

If you need to add a textual prefix to a Microsoft Access auto number field rather than just go with the standard AutoNumber value, this article will demonstarte what actions you should take.

Here's what to do:

Create a new table in design view, including your "Employee ID" auto number field.

You will now need to include the specific format you require in the Format property of the auto number field. In the example shown below you will see the format of: "EMP"000.

Note: you must include the quotation marks around any string value that you wish to include. The 000 (zero's) indicate the value that will follow the textual prefix.

Image showing the property window for the Autonumber field
Example showing the property window and the Format Property for the Autonumber field

Now every time that you tab from the auto number field the value will increase by one to show: EMP001, EMP002 etc.

The results of including the Prefix to the property of the Autonumber field
The results of including the Prefix to the Format property of the Autonumber field