Hide group header in a report

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
 
D

Duane Hookom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top