Loop on the On Format event of a report

J

jeanulrich00

Hi

On a report I have 38 fields Named [AP1], [AP2], [AP3], ......till
[AP38]

As I don't want to see field when to value = 0 (zero), On the On
Format of the Detail of the report I need to put
the following code

Me.AP1.visible = (me.AP1>0)
Me.AP2.visible = (me.AP2>0)
Me.AP3.visible = (me.AP3>0)
Me.AP4.visible = (me.AP4>0) and so on 38 times.

I am lookig for something to simplify the code. Maybe something that
would make a loop. But as I am not familiar with routine like that, i
would need help

thanks
 
L

Larry Linson

Have you looked in Help at the CanShrink property? That may be an easy
approach to accomplishing your purpose.

Larry Linson
Microsoft Office Access MVP
 
J

jeanulrich00

Have you looked in Help at the CanShrink property?  That may be an easy
approach to accomplishing your purpose.

 Larry Linson
 Microsoft Office Access MVP




On a report I have 38 fields Named [AP1], [AP2], [AP3], ......till
[AP38]
As I don't want to see field when to value = 0 (zero), On the On
Format of the Detail of the report I need to put
the following code
Me.AP1.visible = (me.AP1>0)
Me.AP2.visible = (me.AP2>0)
Me.AP3.visible = (me.AP3>0)
Me.AP4.visible = (me.AP4>0)   and so on 38 times.
I am lookig for something to simplify the code.  Maybe something that
would make a loop.  But as I am not familiar with routine like that, i
would need help
thanks- Hide quoted text -

- Show quoted text -

Hi

I have try the Can Shrink but it is not working as the field shrink
just a bit and not completely

so I am back with the first method. I realy need to make a loop with
the code that works

Me.AP1.visible = (me.AP1>0)
and do that for the 38 fields

So I am still waiting for help

thanks
 
Top