Conditionally Control Report Fields Visible Property (1 Viewer)

DoneganF

Registered User.
Local time
Today, 05:53
Joined
Aug 7, 2012
Messages
29
Hello All,
I have a field on a report which I only want to display if the value is greater than zero. I tried the following code and parked it in the Report OnOpen Event. The error this codes generates is;

"You entered an expression that has no value"

Here's the code .....

Private Sub Report_Open(Cancel As Integer)
If Val(Me.NETCOLL) = 0 Then
Me.NETCOLL.Visible = False
Else
Me.NETCOLL.Visible = True
End If

End Sub

Any help is greatly appreciated!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:53
Joined
Oct 29, 2018
Messages
21,473
Hi. On a report, you could try using either the Print or Format event.
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:53
Joined
Sep 21, 2011
Messages
14,288
I would have thought you would want the code in one of the detail events? On Print perhaps?
 

DoneganF

Registered User.
Local time
Today, 05:53
Joined
Aug 7, 2012
Messages
29
Thanks DBGuy .... very helpful. I figured the code was parked in the wrong place. I appreciate your help - and patience!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:53
Joined
Oct 29, 2018
Messages
21,473
Thanks DBGuy .... very helpful. I figured the code was parked in the wrong place. I appreciate your help - and patience!
Hi. You're welcome. Gasman and I were happy to assist. Good luck with your project.
 

Users who are viewing this thread

Top Bottom