Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumber from set point 1

Status
Not open for further replies.

cizmad

Technical User
Jul 6, 2005
14
0
0
US
I'm building a series of databases to keep track of my company's orders that we will eventually switch to to place orders as well (with printable and send-able POs, etc). As I've been entering data, I've been entering old PO numbers as the Order IDs, but I would like to switch to an autonumber starting from the first un-used PO number that we have when we start using the database to place new orders, so that they are automatically kept consecutive (which is now the job of an administrative assistant and a notebook). I'm assuming this can be done, but I can't seem to figure it out. Anyone know the process?
 
Provided the AutoNumber field is not involved in any ReationShip:
ALTER TABLE yourTable ALTER COLUMN yourAutoNumberField COUNTER(newStartNumber,1);

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If you are trying to use the autonumber to keep an ordered set of numbers (like Purchase Orders) then you are using autonumber the wrong way. The autonumber should have no meaning attached to it other than a way to uniquely identify each record.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Well... I'm not using the autonumber *yet*, but the order ID (which is the primary key for the order table) does correspond to the Order PO# - which may, indeed, be a mistake, though it seemed like the most specific and concrete way to number them.

Is there any way to set the Order ID to increase automatically by one for each added record without employing the autonumber feature?

 
In this situation I would usually have the Autonumber as the PK and then another field for the PO Number.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top