472,789 Members | 1,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 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 11968
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.