Adding Line numbers to records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think I may be missing something obvious here but anyway.. (I may also have
posted in the wrong place!)

I have a table of Order Details which are added via a form. Currently when
they are added an autonumber ID field is used to identify them.
How can I get this number to start from 1 for the first detail under an
order and increment as each is added using the input form. So for every order
I have details 1 to however many order lines there are.
The reason I need to do this is so that when the order is printed the
details print with a sensible line number next to them. Should I be trying to
generate the number in the report - is that simpler. (The line number isn't
required other than for the report).
 
There's a dead simple way to get this counter going on the report.

Just open your report in design view, add a text box to the Detail section
of your report, and give it these properties:
Control Source =1
Running Sum Over Group
Format General Number

Each record the value is 1.
The running sum increments it each time, so it counts.
The format lets Access know to treat the calculated control as a number.
 
Many thanks.

Allen Browne said:
There's a dead simple way to get this counter going on the report.

Just open your report in design view, add a text box to the Detail section
of your report, and give it these properties:
Control Source =1
Running Sum Over Group
Format General Number

Each record the value is 1.
The running sum increments it each time, so it counts.
The format lets Access know to treat the calculated control as a number.
 
Back
Top