Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6865785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:05:50+00:00 2026-05-27T03:05:50+00:00

I’m using Access 2010 to create several reports and i can’t figure out how

  • 0

I’m using Access 2010 to create several reports and i can’t figure out how to hide a group heading if its empty.

Imagine I have a table such as (n.b. i know nothing about cars, its just an example):

H1  | H2       | H3     | H4       | DATA1   | DATA2   | DATA3
car | chassis  | engine | pistons  | data_a1 | data_a2 | data_a3
car | chassis  | engine | pistons  | data_b1 | data_b2 | data_b3
car | chassis  | engine | pistons  | data_c1 | data_c2 | data_c3
car | chassis  | engine | cylinder | data_a1 | data_a2 | data_a3
car | chassis  | engine | cylinder | data_b1 | data_b2 | data_b3
car | interior |        | seats    | data_a1 | data_a2 | data_a3
car | interior |        | seats    | data_b1 | data_b2 | data_b3

I have got 3 group headers of columns H1,H2 and H3 in that order. The problem i have is, when H3 contains no text (i.e. “” (I think access evaluates that as null)) i want to hide the group header for H3 or at least make it so it takes no space on the report. Currently wherever H3 is blank, the report still contains a blank row.

I’ve tried this and similar in GroupHeader3’s Paint and or Print events

If IsNull([H3]) Then
    Me.GroupHeader3.Height = 0
    Me.GroupHeader3.BackColor = vbRed
    Me.GroupHeader3.Visible = False
Else
    Me.GroupHeader3.Height = 5
    Me.GroupHeader3.BackColor = vbGreen
End If

The idea seems to work, that is if i comment out the Visible=False line i get a red or a green background in the right places, however it completely ignores the height option.
If i put the Visible=False on it complains that it can’t be put in the on Paint event.

I’ve also tried putting similar code in GroupHeader2’s paint event but to no avail. The closest I’ve got it just sits there and flickers.

I’m kinda new to vba so i might be missing something obvious, but at the moment I’m not really sure how to proceed so any help would be much appreciated.

EDIT
For clarity:

The report is laid out a bit like so:

H1
    H2
          H3
               H4
                    DATA1       DATA2       DATA3

So with the example data above it would appear as:

car
    chassis
              engine
                      pistons
                              data_a1    data_a2    data_a3
                              data_b1    data_b2    data_b3
                              data_c1    data_c2    data_c3
                      cylinder
                              data_a1    data_a2    data_a3
                              data_b1    data_b2    data_b3
    interior

                      seats
                              data_a1    data_a2    data_a3
                              data_b1    data_b2    data_b3

Its the blank line (group header 3) between interior and seats that i want to avoid.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:05:51+00:00Added an answer on May 27, 2026 at 3:05 am

    You are showing us column headers not group headers. What sense does it make to change the hight of H3 if the other headers are still here? You can’t save space that way.

    Probably you want to hide the whole column H3 by moving the columns at the right of H3 to the left by the width of H3. There is no easy way to do that. You will have to calculate the positions of the text fields and lables involved and change their “Left” position accordingly in a OnFormat event.

    EDIT:

    Use the Cancel parameter of the Format event procedure of the group headers:

    Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
        Cancel = IsNull(Me!H0)
    End Sub
    

    Since the VBA code never runs in design mode, you will only see its effect in the print preview and when printing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.