Resetting an Autonumber

D

Duck

I am trying to create a sales subform for our store. I would like to
have each item in each sale numbered starting at one. In my sales
table I have an order number (OrderNo) and a Item number (ItemNo).
Is there some way to set the ItemNo as an Autonumber which will start
over at 1 for each new OrderNo?
 
G

Guest

In a word: No. Autonumbers do not work that way. You'll need to create
something in code to do what you ask.
 
J

Joseph Meehan

Duck said:
I am trying to create a sales subform for our store. I would like to
have each item in each sale numbered starting at one. In my sales
table I have an order number (OrderNo) and a Item number (ItemNo).
Is there some way to set the ItemNo as an Autonumber which will start
over at 1 for each new OrderNo?

No not with an autonumber. You should be able to use the DmMax
function to do what you want programmability. Actually you should not use
Autonumbers anywhere that humans will be seeing them. Autonumbers are not
guaranteed to be consecutive. Numbers may skip one or many numbers for no
apparent reason. Autonumbers are only designed to provide a unique number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top