Generate restarting autonumber

dark11984

Registered User.
Local time
Tomorrow, 04:26
Joined
Mar 3, 2008
Messages
129
I need to design a table or query that can be exported to excel then copied into a write protected upload spreadsheet.

The fields in the upload spreadsheet are:
Order#
Sequence#
SKU
Qty

The sequence number is 1, 2, 3 , etc for each SKU then restarts at each new order #.

I can't figure out how to assign the sequence number in my query or table before exporting it.

Any help would be much appreciated. Thanks.
 
simplest way in your query is to use the dcount method so perhaps something like

sequence: dcount("*","myTable","Order=" & Order & " AND SKU<=" & SKU)

assumes your SKU is a numeric value, if it is text then use
sequence: dcount("*","myTable","Order=" & Order & " AND SKU<='" & SKU & "'")

you will need to order your query by Order, SKU

Note using non alphanumeric characters such as # is not recommended, you can get unexplained errors
 
If you need the sequence to be permanent, you need to assign it when the record is added. Here's a sample that shows how to create two kinds of sequence numbers.

 

Users who are viewing this thread

Back
Top Bottom