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

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

Post by YXN0cmlkY » Sat, 23 Feb 2008 02:29:02


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!
 
 
 

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

Post by Evi » Sat, 23 Feb 2008 06:30:32


for
"Over
Description

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

 
 
 

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

Post by Allen Brow » Sat, 23 Feb 2008 09:58:24

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.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://www.yqcomputer.com/
Reply to group, rather than allenbrowne at mvps dot org.