View Full Version : How to suppress printing of certain controls?


winterglaive
05-14-2006, 12:14 PM
I believe this has something to do with using VBCode...

I need to suppress the printing of certain controls that are based on a table when one of the controls is null.

My little access book gives me this much:

"Hint: Use the Detail section's Format event, and use assignment statements similar to Me![control name].Visible = True/False, where Me refers to the open form, and True/False means to select the appropriate property setting."

So basically that hint is probably spelling out what I need to do, but I'm lost!

LISABBB
05-14-2006, 10:27 PM
Have you tried simply using an IIF statement?

It can be part of the control source property in a calculated control
= IIf([OrderAmount] > 1000, "Large", "Small")

or you can do the VB stuff
Function CheckIt (TestMe As Integer)
CheckIt = IIf(TestMe > 1000, "Large", " ")
End Function

You might also look at the Triple State info that is part of your Access help. I haven't played with it, but that might do you some good too.

geraldcor
05-15-2006, 10:20 AM
If your control is in the detail section then on the on format event in the properties (and subsequently VB) do the following
If IsNull(Me.control) then
Me.control.visible = False
else
Me.control.visible = True