How to set detail item counter to null when detail record is null?

  • Thread starter Thread starter astridc
  • Start date Start date
A

astridc

I have a report that lists the detail records with a numbering
sequence. If one of the detail records is null, the Item no. still shows for
it.

I have tried this in the RecordSource for the Item No. textbox:
IIf (IsNull( [Description]);Null;1) , with RunningSum Property set to "Over
All"


and I set CanShrink to Yes for both the Item no. textbox and the Description
textbox.

It works for the first of the Null records, but for the following null
records, the Item no. textbox shows a "0"

I would need that both the Description textbox and the Item No. textbox
do not show in report when Description contains a null value.

Thanks in advance for your help!
 
astridc said:
I have a report that lists the detail records with a numbering
sequence. If one of the detail records is null, the Item no. still shows for
it.

I have tried this in the RecordSource for the Item No. textbox:
IIf (IsNull( [Description]);Null;1) , with RunningSum Property set to "Over
All"


and I set CanShrink to Yes for both the Item no. textbox and the Description
textbox.

It works for the first of the Null records, but for the following null
records, the Item no. textbox shows a "0"

I would need that both the Description textbox and the Item No. textbox
do not show in report when Description contains a null value.

Thanks in advance for your help!

I don't understand everything you are saying but to make items appear or
disappear according to their value, you can use the OnFormat Event in the
Section that contains the text box

The code will look something like this

If IsNull(Me.Description) then
Me.[Item No,].Visible = False
Else
Me.[Item No.].Visible = True
End If

(Instead of Item No. you would put the name of your text box if it has
another name).

Evi
 
The trick is to filter the records out before they make it to the report.

1. If you don't already have a query to feed this report, create one.

2. In the Criteria row under your [Description] field, enter:
Is Not Null

3. Set this query as the RecordSource for your report.

Now the records don't come to the report if the field is null, and so the
numbering problem is solved.
 
Back
Top