[AccessD] text box in page header

Jim Dettman jimdettman at verizon.net
Mon Nov 10 09:35:48 CST 2008


Carolyn,

  "Two-pass" reports are done simply by adding a text control (hidden or
not) that references the pages property.

  When you do this, you force Access to do two passes on a report.  The
first is a "dry run" through the report so it can figure out what the last
page will be.  The second is when it actually prints the report.

  It's on this first pass that you can store information in a table or
memory and then do all sorts of things on the second pass.  In your case,
I'd make a table in the report's OnOpen event, which you can use to record
the EventType and the page it first appears on.

  You'd do that with code OnFormat event of the EventType header section.
You need to use OnFormat as OnPrint events are not fired on the first pass.
You can tell when your in the first pass of a report by checking pages,
which will be 0.

  Then in the second pass in the Page header OnFormat or OnPrint event, you
can read the table to see what appears on the current page.

  You can do all sort of things with this technique; reset page numbers over
groups, add a to/from for each page in the header or footer of the page
(telephone book style), build a table of contents or an index for the
report, tell what is coming on the next page or appeared on a previous page,
etc.

  Here's a link to a MSKB article which shows the basic technique:

http://support.microsoft.com/kb/131937

  If you have any questions holler.

Jim.


    

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Carolyn Johnson
Sent: Saturday, November 08, 2008 6:18 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] text box in page header

Using the header did not work.

Can you explain how to do a two pass report?   That seems to be the solution

but I've never done that before.

Thanks
Carolyn



----- Original Message ----- 
From: "Jim Dettman" <jimdettman at verizon.net>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Saturday, November 08, 2008 2:00 PM
Subject: Re: [AccessD] text box in page header


> Carolyn,
>
>  Try setting the force new page property to none for the Event ID footer
> and Before section for the force new page property on the header.
>
>  If that doesn't work, then you'll probably need to make it a two pass
> report.  You'd pickup and store the info for each page on the first pass,
> then push it to unbound text controls on the second to show the correct
> info.
>
> Jim.
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Carolyn Johnson
> Sent: Friday, November 07, 2008 9:49 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] text box in page header
>
> The report is a catalog with 2 main groups of records - field name
> EventType.  Each group then has several subgroups.  I want the page header
> to show the value of EventType, along with the date.
>
> There is an EventType footer with the force new page property set to After
> Section.
>
> On the first page for the second EventType, the page header text box
> EventType still has the old value.   It's not until the EventType header
> section that the value changes.
>
> If I put the controls I want to print on each page into the EventType 
> header
>
> with RepeatSection = true, I get the desired effect --  the EventyType and
> Date print at the top of each page --  EXCEPT on the page where the new
> group starts, the text boxes print twice, the first time with the old 
> values
>
> and the second time with the new group's values.
>
>
> Thanks
> Carolyn Johnson
>
>
>
> ----- Original Message ----- 
> From: "Susan Harkins" <ssharkins at gmail.com>
> To: "Access Developers discussion and problem solving"
> <accessd at databaseadvisors.com>
> Sent: Friday, November 07, 2008 8:39 PM
> Subject: Re: [AccessD] text box in page header
>
>
>> Is there just one group per page -- you mentioned wanting it in the
>> header -- do you mean the page header or the group header?
>>
>> Susan H.
>>
>>
>>> It comes from a value in the group.
>>>
>>> Carolyn Johnson
>>>
>>>> Does the header value come from a value in the group or are you just
>>>> sequentially numbering them?
>>>>
>>>>> Access2003, WinXP
>>>>>
>>>>> I have a text box in the page header of a report that changes values 
>>>>> as
>>>>> the
>>>>> records move from one group to another.   This text box on the first
>>>>> page
>>>>> of
>>>>> "group 2" still has the value for "group 1".   Is there a way to get
>>>>> the
>>>>> correct value for a new group level in this text box, or do I have to
>>>>> move
>>>>> text box to the group header section?
>>>>
>>>> -- 
>>>> AccessD mailing list
>>>> AccessD at databaseadvisors.com
>>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>>> Website: http://www.databaseadvisors.com
>>>
>>> -- 
>>> AccessD mailing list
>>> AccessD at databaseadvisors.com
>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>> Website: http://www.databaseadvisors.com
>>
>> -- 
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list