Creating Sequences in Access

crozfader

Board Regular
Joined
Mar 23, 2011
Messages
86
How do I add a unique ID/record count in Access after a d has already been created?

I want to do two things:
- For one table I would like to have a sequence starting a 1 and ending at the last record number
- For another table, I would like to add a sequence that starts at 2 and end at the last record number minus 1

Is there a way to do that?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Also, how do I create complicated sequences such as:


ID ITEM_NUMBER TRANSACTION_DATE QTY

1 XYZ 03/2011 4
2 XYZ 04/2011 6
3 XYZ 05/2011 1
1 ZZZ 01/2011 7 ....



etc. the count would start at 1 every time there is a new item_number.

Thanks
 
Upvote 0
Also, how do I create complicated sequences such as:


ID ITEM_NUMBER TRANSACTION_DATE QTY

1 XYZ 03/2011 4
2 XYZ 04/2011 6
3 XYZ 05/2011 1
1 ZZZ 01/2011 7 ....



etc. the count would start at 1 every time there is a new item_number.

Thanks

There's no built in way of having an autonumber do that. If you really want it then you'd need to use VBA to generate the key for you, although I would not recommend this technique and would suggest that you use a regular autonumber (cleaner and less likely to go wrong).

HTH
DK
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top