In a tedious Microsoft Access report featuring pages and pages of meaningless numbers in a table you quite often want the table headings (the bit labelling the column) to repeat itself at the top of each page. That way the recipient has no excuse for not knowing what a hundred pages of mind-bogglingly dull numbers mean.
Normally Access provides a Page Header section of the report for exactly this purpose. If you can't see it then in the report design view, go to the View menu and select "Page Header/Footer". Whatever you write in this section will appear at the top of each page.
This falls down if the report you're writing is to be a subreport in another report and you want the same behaviour. You can still design the page header, but when you see the final report as a subreport inside another report it won't be there - Access just ignores it. Yay.
However there is a simplish workaround (much more simple that whatever Microsoft's solution is supposed to mean).
Whilst in design view of the subreport, use the sorting and grouping box to add a new group level. If you can't see the box, go to the View menu and choose "Sorting and Grouping". As the top level of the grouping (i.e. first row on that box), rather than group by a field, set the "Field/expression" column to something non-variable, a suggestion being "=1" without the quotes. At the bottom of that window, select to have a group header. This will then give you the equivalent of a Report Header, whereby you get a group header that appears at the top of the report without affecting your data. Whoo.
The magic occurs when you bring up properties of the group header. If you can't see the properties box, go to the View menu then Properties. Then click on the little grey box on the report to the left of the grey line that reads "=1 Header" - assuming you went the =1 suggestion. One property is "Repeat Section". Change this to say Yes. Now add whatever text, controls and so on that you would have put in the Page Header the header of this group (i.e. the blank bit of report directly below the "=1 Header" line.
Save your report, open the main report with it as a subreport, and you will see that the equivalent of page headers are shown. Job complete.
Artist's impression: What it should look like when you're done

Comments
This acutally works
wow. (Y)
Thanks for that
Used Access for 10 years and have only just found this problem.
Nice simple solution, thanks very much.
Agreed, great little
Agreed, great little shortcut for an extremely tedious problem.
No problem, glad it helped.
No problem, glad it helped. It would be nice if they could just build in such a feature of course!
Incase you already have a sorting criteria...
Just figured out there was a problem following these steps when a sort criteria already exists in the sort list. If this is the case for you, follow the steps as suggested here, then:
- select the group row from the "Sorting and Grouping" popup box
- drag it and drop it to the top of the list
This will prevent the header appearing before every group of rows sorted by the preceding criteria.
Great, thanks for the tip!
Great, thanks for the tip!
Thanks!
Thank you for the clear explanation and screenshot. I ran into this Access problem for the first time just 5 minutes ago, and I found the fix right here.
No problem, glad it helped!
No problem, glad it helped!
Thx a lot
nice solution, much appreciated!
This works beautifully!
This works beautifully! Thanks!
Faking headers in subreports
You are a god!!!!!!!!!!!!!!!!! And I love the way you write. I was looking at that macro stuff explaination on MS website and thinking I was doomed. So glad your site popped up on my internet search!!!!!!!!!
my subreport uses columns
my subreport uses columns how do i use the fix?
My wife loves you
You just saved me at least 10 hours of work! You're the bomb! I'll actually see my wife tonight thanks to you!
Glad to be of service.
Glad to be of service. Saving marriages is all part of the special Feb 29th service here!
This is genius...
Thanks so much...this solves a big problem for me.
Faking page headers on a Microsoft Access subreport
You're a God send.
Thanks a million
Peter
Lynwood
Western Australia
very good much appreciated
very good much appreciated but why is access being so difficult in the first place?
is there a better database application available?
also does any one have a
also does any one have a decent way of making the microsoft access application window disappear when the database loads, so that the database looks like a professional stand alone application when used? i downloaded some code that someone created as a module to do this, but there must be a better way?
Thanks in advance my little geniuses!!!
Faking subreport headings
Unbelievable. First, MS designs this "flaw", then you provide a stunning work-around. It is elegant; it is perfect.
I thank you. My clients will thank you. This qualifies for my "learn one new thing every day" rule.
Kudos, and thanks again.
Oh, and did I say, "Thanks"?
Thanks!
Wow, you just saved me a lot
Wow, you just saved me a lot of time and a big headache!
Genius!!!!!
Genius!!!!!
Fab!
15 years access experience and only just hit this issue - and on the most important reports I've ever needed to produce! Thanks a million!
Access Subreport Page Headers
Very many thanks. You saved me having to struggle on for another hour or so !
kudos!
Thanks a lot for your important contribution - kudos.
Header problem fixed
Whoohey, thanks allot dude... This really worked out great.
It so simple!!
Thanks for documenting this solution in an easy problem/solution format. I might not remember this solution next time I need it, but just know it exists make me feel so good!
Page header missing after 1st page
think this is because it is still part of the same group ie "=1". Any ideas?
Wow this works
Thanks so much. Solved a minor headache for me and once again beats the pants off of MSFT's solution.
Doesn't it just! Thank you
Doesn't it just!
Thank you very much for the help and instruction. It is very much appreciated!
Thanks for the help
Thanks for the tip
Great!
Thanks for this explanation. I kept on playing around with the form/subform thinking I was missing something. Glad
to know if was an Access error and not me! Can't believe I spent 3 hours blaming myself! ;-P Thanks
for your quick and easy fix.
Great write up! Thanks!!!
Great write up! Thanks!!!
Awsome
Thanks a ton for an elegant solution to another one of those head scratchers that Microsoft Access so often presents us with. AWSOME!
Saving my time at Last!
Thanks a Million, no need to scratch head for the access script just to get repeated page header to the other side..since im creating a 2 side data into 1 page...
Thanks muah muahh (^ _ ^)/
http://allaboutads-makemoney.blogspot.com
Thanks!!!
Thanks so much. Great write up!
Awesome , this worked!
Awesome , this worked!
Thanks, you are a genius
Thanks a lot dude, I have been head breaking about this issue and this just saved my day.
xvxv
Just figured out there was a problem following these steps when a sort criteria already exists in the sort list. If this is the case for you, follow the steps as suggested here, then:
- select the group row from the "Sorting and Grouping" popup box
- drag it and drop it to the top of the list
This will prevent the header appearing before every group of rows sorted by the preceding criteria.
Bravo!
You've really been helpful. You're right about the bizarre Microsoft workaround. Well done, and thanks.
Thnaks for your overview
The best way to handle this is to force a new page after a set number of records have printed. I have done this and it works.
The first step is to create a few formulas to keep track of your record counts.
//@reset_var
whileprintingrecords;
numberVar record_cnt := 0;
Place the above in your group header in the subreport. We want to reset the variable every time the group header prints.
Next, create this formula to increment the counter for each record, and place the formual in your details section:
//@increment_var
whileprintingrecords;
numberVar record_cnt := record_cnt + 1;
Now, the next step is to determine who many records comfortably fit on one page.
Once you have determined that, go to Format, Section.
Highlight details, and click the X+2 button next to the New Page After property.
In the formula editor that opens and this line:
{@increment_var} = 20 // replace 20 with the number of records that fits you report
You also must make sure that you have the "Repeat Group Header on each page" option set.
Give it a try. Let me know if you have anyother issues with it.
Awsome
Thanks a ton for an elegant solution to another one of those head scratchers that Microsoft Access so often presents us with. AWSOME!
Thanks for your Overview
The problem is that your fakeheader is actually a group header. You can't force a group header to print before a page footer because if the combined group header/footer exceeded the length of a page then you'd be caught in an endless loop.
I believe you've just run into a limitation of the workaround and AFAIK there's no way to correct this.
Post new comment