Hide group header in a report

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I am trying to put a code into the Format event of a group
header in a report to check wheteher a text box is Null or
not and set the Visible property of the group header, but
all in vain - the headear is still shown. I'm a beginner
in programming. Please, have a look at the code and point
out the mistake.

Private Sub Group2Header_Format(Cancel As Integer,_
FormatCount As Integer)
If Me.[Amount1] = Null Then
Group2Header.Visible = False
Else Group2Header.Visible = True
End If
End Sub

Thanks
 
Try:
Private Sub Group2Header_Format(Cancel As Integer,_
FormatCount As Integer)
If IsNull(Me.[Amount1]) Then
Group2Header.Visible = False
Else
Group2Header.Visible = True
End If
End Sub

or
Private Sub Group2Header_Format(Cancel As Integer,_
FormatCount As Integer)
Group2Header.Visible <> IsNull(Me.[Amount1])
End Sub
 
Back
Top