Sequential numbering records (skipping some records)

J

JimAA

I would like to sequentially number selected records shown on a report. I
understand about adding calculated controls with control source set to =1,
etc. My question is how can I get a calculated control ("Item No." shown in
the example below) to skip the numbering of some records based on an If, Then
condition. The record numerically skipped would still appear on the report -
it just would not have a number displayed. The numbering would continue
where it left off on the next record after that.

Example below (the RecordDetailID would not appear on the report):

Item No. Change Description Change Cost RecordDetailID
-------------------------------------------------------------------
OFFICE
1
1 Add carpeting $1,000.00 2
2 Add window $500.00 3
WAREHOUSE
4
3 Add door $2,000.00
5
4 Add window $500.00 6

Thanks.
 
M

Marshall Barton

JimAA said:
I would like to sequentially number selected records shown on a report. I
understand about adding calculated controls with control source set to =1,
etc. My question is how can I get a calculated control ("Item No." shown in
the example below) to skip the numbering of some records based on an If, Then
condition. The record numerically skipped would still appear on the report -
it just would not have a number displayed. The numbering would continue
where it left off on the next record after that.

Example below (the RecordDetailID would not appear on the report):

Item No. Change Description Change Cost RecordDetailID
-------------------------------------------------------------------
OFFICE
1
1 Add carpeting $1,000.00 2
2 Add window $500.00 3
WAREHOUSE
4
3 Add door $2,000.00
5
4 Add window $500.00 6


I can't decode your example so I'm not sure what you want.
It looks like you have a grouping on something like
departmentfield and don't want to number the department line
(which should be in a departmant group header section). But
that's the normal way a running sum Over All works so it
seems that you want someting else.

To answer your specific question, you can not number a
detail by using an expression like:
=IIf(some condition, 1, 0)
instead of just =1

If you want to hide the number when it doesn't change, just
set the text box's HideDuplicates property to Yes.
 

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