By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

AutoNumber Options

P: 67
I want to create an AutoNumber type field that uses prefixes. For instance, the Employee numbers would be E-1, E-2, E-3... and the Task numbers would be T-1, T-2, T-3...

How can I accomplish this?

Thanks!

CB55
Feb 21 '08 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 2.5K+
P: 2,545
I want to create an AutoNumber type field that uses prefixes. For instance, the Employee numbers would be E-1, E-2, E-3... and the Task numbers would be T-1, T-2, T-3...

How can I accomplish this?

Thanks!

CB55
Hi. Autonumbers are not the answer to your requirement, for two reasons. Firstly, your requirement is for a compound key (in this case a two-part key). Autonumbers are just numbers - automatically incremented, but still just numbers. Secondly, even if you create a two-part key with the second part an autonumber, it increments in record-added sequence and cannot be reset to 1 for each new prefix you add.

Your compound key can be created using a combination of a character field and a Long, but the incrementing will need to be done programmatically or using SQL.

-Stewart
Feb 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.