Is it possible to start record ID from any number?

Manc

bitten, more than, chew!
Local time
Today, 23:30
Joined
Jan 11, 2010
Messages
25
Hi there.

My Quotes table has its unique reference number generated each and every time, but our company is currently on 83000. My new Form is on 4.
Is there away, without entering 82996 dummy records, for this to 'catch up'?


Thanks for your help
Manc
 
It is possible for I have seen the question answered in previous posts. Search the forum and you should find it.

But... An autonumber should not have any meaning to the record except to provide a unique number for referencing purposes.
 
Hi there.

My Quotes table has its unique reference number generated each and every time, but our company is currently on 83000. My new Form is on 4.
Is there away, without entering 82996 dummy records, for this to 'catch up'?


Thanks for your help
Manc
create another table with a numeric field.Enter the number you want to start from. Append this from append query to your quotes table id field.
 
ghudson...

I am new to Access and am learning all the time...

You say the autonumber should not have any meaning. How would I generate a unique job number for each record automatically.

What i've learn't so far, I have examined the Northwind example, i'm guessing that's not the best reference.

Thanks for your help
Manc
 
Using the autoumber field is import and I use the Long Integer Field Size and Random option for new values as my way of not caring what the number is as long as it is unique for referrencing.

I have never had a situation where I needed to create a job number but I can say your question is common and the typical answer is to search the forum for the keywords [autonumber dmax] and you should find lots of posts on the subject. Pay attention to the warnings on how not to do it to prevent future problems.
 
chundusmgs, would it be possible for you to post an example db using append.

Thanks for your help guys
Manc
 
i will upload the sample db in my website learn-msaccess.weebly.com. pl download.
 
the idea behind this is as follows

you have a table, where you want to record orders, and probably ANOTHER table of order lines linked to those orders - so you need an ID number to link the tables

SO:
A) use a meaningful ID number as the key in the order table, and use this as the record link (also called the foreign key) in the order lines table

Then - generate the order numbers EITHER
a) manually - entering the order number you want each time
b) allow the sytem to find the next order number in some automatic way

NOW - since using a meaningful key is not always the best policy an alternative approach is

B) use a non-meaningful ID number as the key in the order table, and use this as the record link (also called the foreign key) in the order lines table. This can be an autonumber, and in this case, it is important to understand that this doesnt have to run in any sequence, and indeed a sequence cannot be guaranteed

BUT
you STILL need the same meaningful order number in the orders table, which still has to be instantiated in some way. Its just that NOW this value isnt the foreign key in the order lines table - the autonumber field from the orders table, should be the foreign key. If you inspect the order lines table, you will now see this relatively meaningless number in the order table - not the actual order number

------------------

This latter idea is actually simpler and more efficient for Access - although it involves the slight overhead of managing an extra key on the orders table. (overhead for Access, not for the user)

And that is why a lot of users here, tend to recommend adding an autonumber key to (virtually) all tables -


--------------
NOW - as far as generating the order number you can

a) enter one directly - OR
b) have another table where you store the next number you want to use - OR
c) get the next number by looking up the last number used, and adding one to it.

A lot of people use option c - but this may not be what you want, so idea a or b, may be more appropriate.
if oyur order numbers include letters as well as numbers, its a bit more fiddly, as you cant add 1 to a text value.
 
chundusmgs - Thanks very much. Exactly what I need to happen. Appreciate the example and have learned from it. Thanks.

dave - thanks for breaking it down into terms I understand and appreciate the time you spent on my post. Again, much learned and taken on board.

Thanks to you both
Manc
 

Users who are viewing this thread

Back
Top Bottom