Label made visible based on value in detail row

S

SME

Hello!

I would like to make one label (paragraph) visible based
on a value in a detail row. While I can do this if there
is only one value, a problem arises when I have more than
two detail rows, each with a different value.

For example,

Group Header: Company Name

Detail: specialFlag = false
Detail: specialFlag = true

Group Footer: If special flag true have this label
(paragraph) visible. -- I have several paragraphs in the
footer section ... I only want one to appear/not appear
based on the detail value.

How to I get the paragraph to be visible/not visible if
there are *any* rows with a true value?

The code which works if there is only one detail row is
below.

MTIA


Private Sub GroupFooter0_Print(Cancel As Integer,
PrintCount As Integer)

If Me.specialFlag = True Then
Me.PRIORITYTEXT.Visible = True
Else
Me.PRIORITYTEXT.Visible = False
End If

End Sub
 
T

Terry

SME,

You could sum the "flag" field. Assuming it is a yes/no
check box sort of field it will store -1 for a yes and 0
(zero) for a no. eg if(sum(myflag)<0,visible,invisible).

I think this could be done with an expression in the
conditional formatting feature without any coding.

HTH,

Terry
 
G

Guest

Yup, that worked for making the label visible/invisible
on the correct page(es), tho I did keep it in the
GroupFooter1_Print event like so.

If Me.txtSumPriority = 0 Then
Me.PRIORITYTEXT.Visible = False
Else
Me.PRIORITYTEXT.Visible = True
End If

But the paragraph/label still takes up 3 lines whether
it's visible or not ... I've tried setting everything
possible to 'can shrink' but I still have a blank space.
Is there a way to have the space close up when the label
is invisible?

Again, MTIA
 
T

Terry

SME,

The control and the control's section will need to have
can shrink set to yes. If there are any other controls in
the same horizontal range as the "invisible" control the
section will not shrink.

HTH

Terry
 
Top