Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

ms+access+course/ - adding prefix auto number

Forum home » Delegate support and help forum » Microsoft Access Training and help » ms+access+course/ - Adding a prefix to an auto number

ms+access+course/ - Adding a prefix to an auto number

ResolvedVersion Standard

Marc has attended:
Access Intermediate course
Access VBA course
Access Advanced course

Adding a prefix to an auto number

i need to add a prefix depending on a selection made from a combo box in a form how would i go about this?

RE: adding a prefix to an auto number

Marc

To Add the same prefix to an Autonumber:

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

You will need to add the specific format you require in the Format property of the auto number field:

eg "REC"000

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

If the prefix changes depending on the value selected in the combo box it may need a bit of VBA code (An IF loop) to change the field's format each time a number is entered.

Regards

Carlos


Carlos

Access tip:

Deleting duplicate records from a table

You cannot delete records tables where there duplicate records. A way around this is to create a new table which wont hold the duplicates. and then deleting the old table.

1. Use a make-table query based on this table only. IMPORTANT - Ensure that you include all of the fields from your original table or you may loose data.

2. Open the query's property sheet by using VIEW, QUERY, PROPERTIES, and set the Unique Values property to Yes

3. Because you have selected the Unique Values to Yes when you run the query, Access creates a new table without duplicate records. You can now delete the old table and rename the new one.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.2 secs.