for Microsoft Access
Create complex MS Access databases without being an expert in relational database design! Designer for Microsoft Access asks you plain-language questions about what you want to manage with your database, and creates the tables and relationships automatically. Free trial available
Auto numbering is a handy little feature that will search out the next consecutive or random number for you, and as the name suggests, it does it automatically. It then adds that number into the field where the data type is set to 'AutoNumber'.
When talking about Microsoft Access, auto numbering should only be used when you want to create a primary key, but don’t want it to have any real significance to it, other than the fact that it is unique.
As a matter of fact, there is. You should never use auto numbering for numbers that mean something to you, the item itself or product that is being stored. This is because if you ever needed to change it, which you most likely will want to sometime in the future, you won’t be able to using this method.
The answer to that is ultimately 'yes'. Auto numbering your items can lead to spaces or 'gaps' being left inside your table. These spaces can never be recovered once they have been created. They are created because auto numbering only guarantees that the number hasn't been used before – they don’t guarantee that they are in sequence. Anytime you create a record, but it gets cancelled or deleted, you will end up with a space in your auto numbering field that cannot be deleted or changed.
How do you use it?
It's very easy to set a field to auto numbering. When you are in the design view for your Microsoft Access database, just choose a field name, and then set its data type to be 'AutoNumber'. From there you have a few choices to make.
If you don't wish to use the auto numbering feature in Microsoft Access, you could always create a system of your own. This is not a good idea if you wish to be working with randomly generated numbers, because it would be very difficult to tell just which ones have already been used.
If you were looking for an alternative way of creating an incrementing number however, one of the ways people usually do this is to use the DMax domain aggregate function.
Yes, by pressing ALT-F11 you will switch to VBA mode and from there, you can type activedocument.Range.ListFormat.ConvertNumbersToText into the lower right window. That will switch all the auto numbers you had generated in that field to text ready to be used elsewhere if needed.
Readers of this article may also like to check out other articles on this subject: