Hiding fields base on a condition

srbooth

Registered User.
Local time
Today, 18:34
Joined
Feb 11, 2007
Messages
24
I'm using the following code in the event On Format of a report.

If Me.SalesTargetUsed = 0 Then Me.SalesActual.Visible = False

It works except for the fact it makes all the fields hidden after it finds the first one that meets the condition above. I want it to only apply to the fields that meet the condition through the whole report.

Thanks
 
you need to explicitly make it visible/not visible


If Me.SalesTargetUsed = 0 Then
Me.SalesActual.Visible = False
else
Me.SalesActual.Visible = true
end if

or more succintly

SalesActual.Visible = nz(SalesTargetUsed,0) = 0

you dont need the me qualifier
you may need the nz, in case the value is null
 

Users who are viewing this thread

Back
Top Bottom