473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Format event of a report's section

What specifically causes the Format event of a report's section to fire?

Thanks!

Melissa
Nov 13 '05 #1
3 12081
On Thu, 30 Sep 2004 15:27:40 GMT, "Melissa" <mb****@earthlink.net>
wrote:
What specifically causes the Format event of a report's section to fire?

Thanks!

Melissa

Not sure if the Access help is not specific enough but here it is from
Access 97. The only thing I would say is that you need to be aware of
the retreat event.

David

The Format event occurs when Microsoft Access determines which data
belongs in a report section, but before Microsoft Access formats the
section for previewing or printing.

Remarks

To run a macro or event procedure when this event occurs, set the
OnFormat property to the name of the macro or to [Event Procedure].
A Format event occurs for each section in a report. This allows you to
create complex running calculations by using data from each section,
including sections that aren't printed.
For report detail sections, the Format event occurs for each record in
the section just before Microsoft Access formats the data in the
record. A Format macro or event procedure has access to the data in
the current record.

For report group headers, the Format event occurs for each new group,
and a Format macro or event procedure has access to the data in the
group header and the data in the first record in the detail section.
For report group footers, the Format event occurs for each new group,
and a Format macro or event procedure has access to the data in the
group footer and the data in the last record in the detail section.
By running a macro or an event procedure when the Format event occurs,
you can use data in the current record to make changes to the report
that affect page layout. For example, you can display or hide a
congratulatory message next to a salesperson's monthly sales total in
a sales report, depending on the sales total. After the control is
displayed or hidden, Microsoft Access formats the section by using the
values of format properties, such as CanGrow, CanShrink,
HideDuplicates, KeepTogether, and Visible.

For changes that don't affect page layout or for event procedures or
macros that should run only after the data on a page has been
formatted, such as a macro that prints page totals, use the Print
event for the report section.
There are times when Microsoft Access must return to previous sections
on a report to perform multiple formatting passes. When this happens,
the Retreat event occurs as the report returns to each previous
section, and the Format event occurs more than once for each section.
You can run a macro or event procedure when the Retreat event occurs
to undo any changes that you made when the Format event occurred for
the section. This is useful when your Format macro or event procedure
carries out actions, such as calculating page totals or controlling
the size of a section, that you want to perform only once for each
section.
Nov 13 '05 #2
David,

Can you help me with this ---

I have a grouped report with a subreport in the group footer and the report
starts a new page for each group. The subreport is based on a query which
has criteria in one of the fields. I have a function in a standard module
where the value of the function is part of the criteria. I need to run the
function for each group and have the query requery so the subreport prints
the correct records. Where do I call the function and how do I get the query
to requery so the subreport prints the correct records?

Thanks for any help you can give!!

Melissa

"David Schofield" <d.***************@blueyonder.co.uk> wrote in message
news:415c8157.610116661@localhost...
On Thu, 30 Sep 2004 15:27:40 GMT, "Melissa" <mb****@earthlink.net>
wrote:
What specifically causes the Format event of a report's section to fire?

Thanks!

Melissa

Not sure if the Access help is not specific enough but here it is from
Access 97. The only thing I would say is that you need to be aware of
the retreat event.

David

The Format event occurs when Microsoft Access determines which data
belongs in a report section, but before Microsoft Access formats the
section for previewing or printing.

Remarks

To run a macro or event procedure when this event occurs, set the
OnFormat property to the name of the macro or to [Event Procedure].
A Format event occurs for each section in a report. This allows you to
create complex running calculations by using data from each section,
including sections that aren't printed.
For report detail sections, the Format event occurs for each record in
the section just before Microsoft Access formats the data in the
record. A Format macro or event procedure has access to the data in
the current record.

For report group headers, the Format event occurs for each new group,
and a Format macro or event procedure has access to the data in the
group header and the data in the first record in the detail section.
For report group footers, the Format event occurs for each new group,
and a Format macro or event procedure has access to the data in the
group footer and the data in the last record in the detail section.
By running a macro or an event procedure when the Format event occurs,
you can use data in the current record to make changes to the report
that affect page layout. For example, you can display or hide a
congratulatory message next to a salesperson's monthly sales total in
a sales report, depending on the sales total. After the control is
displayed or hidden, Microsoft Access formats the section by using the
values of format properties, such as CanGrow, CanShrink,
HideDuplicates, KeepTogether, and Visible.

For changes that don't affect page layout or for event procedures or
macros that should run only after the data on a page has been
formatted, such as a macro that prints page totals, use the Print
event for the report section.
There are times when Microsoft Access must return to previous sections
on a report to perform multiple formatting passes. When this happens,
the Retreat event occurs as the report returns to each previous
section, and the Format event occurs more than once for each section.
You can run a macro or event procedure when the Retreat event occurs
to undo any changes that you made when the Format event occurred for
the section. This is useful when your Format macro or event procedure
carries out actions, such as calculating page totals or controlling
the size of a section, that you want to perform only once for each
section.

Nov 13 '05 #3
On Fri, 01 Oct 2004 00:59:07 GMT, "Melissa" <mb****@earthlink.net>
wrote:
David,

Can you help me with this ---

I have a grouped report with a subreport in the group footer and the report
starts a new page for each group. The subreport is based on a query which
has criteria in one of the fields. I have a function in a standard module
where the value of the function is part of the criteria. I need to run the
function for each group and have the query requery so the subreport prints
the correct records. Where do I call the function and how do I get the query
to requery so the subreport prints the correct records?

Thanks for any help you can give!!

Melissa

Hi
Not sure I understand all of this, but I suggest that if your function
has as one of its arguments a field which has a different value for
each group, it should automatically recalculate where needed. Not sure
why you would need to requery.
David

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott Sabo | last post by:
I have a form & report based on a query which shows details about employees performance reviews (hire date, review date, review submital date, etc). We do 90 day probation reviews as well and I...
3
by: marwa mohamed | last post by:
salamo alikom hi all when i run report that includes image control linked to a field in the table that contains the image path(on the server)and the record source of the report contains over 30...
3
by: kmacon | last post by:
I have a form that contains a command button. The command button's OnClick event builds a report using the CreateReport and CreateReportControl functions and then opens the main report. I set...
1
by: Tom | last post by:
In the Developers Handbook, Getz provides a way to create a survey report that displays either a line, Yes/No or multiple choice for each question. It's done by placing three controls (one for each...
3
by: David W. Fenton | last post by:
I ran into a weird problem with a subreport with an OnFormat event of the subreport detail. When I view the field list in report design view, all the aliased fields in the recordsource are...
3
by: dancole42 | last post by:
So I've never used VB in a report before, but I'm taking a shot at it. Just as a test to see if I'm doing it right, I'm trying to set up an invoice where a particular rectangle will change from...
4
by: Karl | last post by:
How do you set the width of a control in the detail section of a report using the On Format event for the detail section?
6
by: MLH | last post by:
I have a small bitmap graphic on a report. I would like to set it's Visible property to True whe the value of a certain field on the report is True. Can I do that? I have tried in the OnFormat...
1
by: AMD_GAMER | last post by:
Hi, I am trying to print address labels. I have a form which asks for the user to input the first name, middle initial, and last name. On the button click to print the label, I have an event...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.