Autonumber

Red6

Registered User.
Local time
Today, 22:03
Joined
Jan 9, 2003
Messages
28
Hi

I have been working on a database structure for some time now and the test data I have been entering has generated Order Numbers using the Autonumber function.

Once I get to the point where I am happy that I have got the database to a condition where I can start to use it in anger, I want to have the Autonumber reset.

1. Is it possible to start again from 1?
2. Is it possible to start the sequence say from 1001?

Are there any threads or links which could explain whether this is possible and how to achieve it, as my knowledge of Access is restricted to a fairly basic self taught level.

Many thanks

Ian
 
You should not care what the autonumber is. Autonumbers should really only be used to generate unique numbers as primary keys that the program views but users should not be viewing, so it shouldn't matter what they are. Autonumbers are not guaranteed to be consecutive so if you are using them for something you should not care if there are gaps or if they suddenly jump hundreds or thousands of numbers. If this is the case then you can reset them and then live with what happens.

If you do care what the numbers are you should then create your own method of generating the numbers (there are many posts here about that) instead of using autonumbers.
 
Ah I see - Thanks Bob,

What I am trying to do is to create a number which uniquely identifies an order, and which increments each time a new order is raised.

I thought (incorrectly it seems) that the Autonumber was the way of doing this.

Would it be possible to point me in the direction of where I might find what it is I am trying to achieve.

Thanks

Ian
 
I have found this thread where you have previously been involved Bob, and have made some changes as suggested, however, I get the error message:

Microsoft Access cannot find the macro 'Me'


http://www.access-programmers.co.uk...p?t=145523&highlight=incremental+number+field


Sorry but I am struggling here.

Ian

That would mean that you have placed the code in the PROPERTY instead of the VBA window. See here how to get to the code window:
http://www.btabdevelopment.com/main/QuickTutorials/Wheretoputcodeforevents/tabid/56/Default.aspx
 
Great stuff - Thanks Bob

Seems to be working now - well at least it's generating a number.

Many thanks

Ian
 

Users who are viewing this thread

Back
Top Bottom