Hide a GroupHeader

arthurmq

Board Regular
Joined
May 29, 2004
Messages
81
Hi, I’m trying to use the following code in a report to hide the ‘GroupHeader0’ whenever ‘Text1’ is blank, but is not working. When I typed ‘If Me![Text1] .Text’ in vb, after the dot the “Text” option is not under the drop down list as an option. Do I need to set different property?
Any help will be greatly appreciated
Thank you


Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If Me![Text1] .Text = "" Then
Me.GroupHeader0.Visible = False
Else
Me.GroupHeader0.Visible = True
End If
End Sub
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try one of these 2 ways:

if me![text1] = "" then.....
or
if isnull(me!text1)=true then......

Hope this helps !!

Joe in Oxford, CT. USA.

arthurmq said:
Hi, I’m trying to use the following code in a report to hide the ‘GroupHeader0’ whenever ‘Text1’ is blank, but is not working. When I typed ‘If Me![Text1] .Text’ in vb, after the dot the “Text” option is not under the drop down list as an option. Do I need to set different property?
Any help will be greatly appreciated
Thank you


Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If Me![Text1] .Text = "" Then
Me.GroupHeader0.Visible = False
Else
Me.GroupHeader0.Visible = True
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,826
Messages
6,162,192
Members
451,752
Latest member
majbizzaki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top