A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Only display page header if Detail session has data



 
 
Thread Tools Display Modes
  #1  
Old October 24th, 2005, 05:14 PM
Tran Hong Quang
external usenet poster
 
Posts: n/a
Default Only display page header if Detail session has data

Hi,
I have some column titles on page header and summary session on Report
Footer. It is nice for the middle pages which have data on Detail session and
column titile on the top of the pages. But on the last page, there may no
data on Detail session, only my summary information, but the page header
still be displayed.

How to hide page header if Detail Session has no data ?

Thanks for help

Tran Hong Quang

  #2  
Old October 24th, 2005, 06:10 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Only display page header if Detail session has data

Tran Hong Quang wrote:
I have some column titles on page header and summary session on Report
Footer. It is nice for the middle pages which have data on Detail session and
column titile on the top of the pages. But on the last page, there may no
data on Detail session, only my summary information, but the page header
still be displayed.



Add a hidden text box named txtLineCnt to the detail
section. Set its control source expression to =1 and
RunningSum property to Over All.

Now, add another hidden text box named txtTotalCnt to the
report header section and set its control source expression
to =Count(*)

Now add a line of code to the detail section's Format event
procedureL
Me.Section(3).Visible = (Me.txtLineCnt Me.txtTotalCnt)

--
Marsh
MVP [MS Access]
  #3  
Old October 24th, 2005, 09:31 PM
Tran Hong Quang
external usenet poster
 
Posts: n/a
Default Only display page header if Detail session has data

Thank Marshall for your help.

But I have problem with Page Header, not Report Header. Putting an counter
on Page Header will create error (txtTotalCnt with ControlSource=Count(*)
will raise error).

Regards
Tran Hong Quang

"Marshall Barton" wrote:

Tran Hong Quang wrote:
I have some column titles on page header and summary session on Report
Footer. It is nice for the middle pages which have data on Detail session and
column titile on the top of the pages. But on the last page, there may no
data on Detail session, only my summary information, but the page header
still be displayed.



Add a hidden text box named txtLineCnt to the detail
section. Set its control source expression to =1 and
RunningSum property to Over All.

Now, add another hidden text box named txtTotalCnt to the
report header section and set its control source expression
to =Count(*)

Now add a line of code to the detail section's Format event
procedureL
Me.Section(3).Visible = (Me.txtLineCnt Me.txtTotalCnt)

--
Marsh
MVP [MS Access]

  #4  
Old October 24th, 2005, 11:08 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Only display page header if Detail session has data

There is no problem with the Report Header. If you don't
have that section, add it and make it invisible.
--
Marsh
MVP [MS Access]


Tran Hong Quang wrote:
But I have problem with Page Header, not Report Header. Putting an counter
on Page Header will create error (txtTotalCnt with ControlSource=Count(*)
will raise error).


Tran Hong Quang wrote:
I have some column titles on page header and summary session on Report
Footer. It is nice for the middle pages which have data on Detail session and
column titile on the top of the pages. But on the last page, there may no
data on Detail session, only my summary information, but the page header
still be displayed.



"Marshall Barton" wrote:
Add a hidden text box named txtLineCnt to the detail
section. Set its control source expression to =1 and
RunningSum property to Over All.

Now, add another hidden text box named txtTotalCnt to the
report header section and set its control source expression
to =Count(*)

Now add a line of code to the detail section's Format event
procedureL
Me.Section(3).Visible = (Me.txtLineCnt Me.txtTotalCnt)

  #5  
Old October 25th, 2005, 12:36 AM
Tran Hong Quang
external usenet poster
 
Posts: n/a
Default Only display page header if Detail session has data

Hi,
I have report displaying User data and grouped by User, new User will start
on new page. One User data may occupy some pages, so that I put Column Title
on Page Header. The problem that for the first page of given User, there is
already User header session, I don't want to display Page Header.

Put a counter on Report Header doesn't help in this case. Report Header
counter always show the total row, so that it is always greather than counter
on Detail session dispite that is the first page of user or not.

Thanks
Quang

"Marshall Barton" wrote:

There is no problem with the Report Header. If you don't
have that section, add it and make it invisible.
--
Marsh
MVP [MS Access]


Tran Hong Quang wrote:
But I have problem with Page Header, not Report Header. Putting an counter
on Page Header will create error (txtTotalCnt with ControlSource=Count(*)
will raise error).


Tran Hong Quang wrote:
I have some column titles on page header and summary session on Report
Footer. It is nice for the middle pages which have data on Detail session and
column titile on the top of the pages. But on the last page, there may no
data on Detail session, only my summary information, but the page header
still be displayed.


"Marshall Barton" wrote:
Add a hidden text box named txtLineCnt to the detail
section. Set its control source expression to =1 and
RunningSum property to Over All.

Now, add another hidden text box named txtTotalCnt to the
report header section and set its control source expression
to =Count(*)

Now add a line of code to the detail section's Format event
procedureL
Me.Section(3).Visible = (Me.txtLineCnt Me.txtTotalCnt)


  #6  
Old October 25th, 2005, 01:37 AM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Only display page header if Detail session has data

Is this a new question or have I completely misunderstood
the question you originally asked?

If it is a new question, did you get the original problem
taken care of?

For this question, you might want to try removing the page
header and setting the group header section's RepeatSection
property to Yes.
--
Marsh
MVP [MS Access]


Tran Hong Quang wrote:
I have report displaying User data and grouped by User, new User will start
on new page. One User data may occupy some pages, so that I put Column Title
on Page Header. The problem that for the first page of given User, there is
already User header session, I don't want to display Page Header.

Put a counter on Report Header doesn't help in this case. Report Header
counter always show the total row, so that it is always greather than counter
on Detail session dispite that is the first page of user or not.


"Marshall Barton" wrote:
There is no problem with the Report Header. If you don't
have that section, add it and make it invisible.


Tran Hong Quang wrote:
But I have problem with Page Header, not Report Header. Putting an counter
on Page Header will create error (txtTotalCnt with ControlSource=Count(*)
will raise error).


Tran Hong Quang wrote:
I have some column titles on page header and summary session on Report
Footer. It is nice for the middle pages which have data on Detail session and
column titile on the top of the pages. But on the last page, there may no
data on Detail session, only my summary information, but the page header
still be displayed.


"Marshall Barton" wrote:
Add a hidden text box named txtLineCnt to the detail
section. Set its control source expression to =1 and
RunningSum property to Over All.

Now, add another hidden text box named txtTotalCnt to the
report header section and set its control source expression
to =Count(*)

Now add a line of code to the detail section's Format event
procedureL
Me.Section(3).Visible = (Me.txtLineCnt Me.txtTotalCnt)



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PST file has reached maximum size Jeff C General Discussion 2 October 6th, 2005 01:35 PM
Auto numbering store5064 General Discussions 11 June 2nd, 2005 08:38 PM
Group header doesn't print with the data when the data spans more than one page. Steve Haught via AccessMonster.com Setting Up & Running Reports 0 February 11th, 2005 02:38 PM
SQL view of messed up action queries Kendra Running & Setting Up Queries 2 August 31st, 2004 09:53 PM
Headers and Footers Pat Jennings Page Layout 9 July 29th, 2004 07:39 PM


All times are GMT +1. The time now is 07:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.