473,508 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page event "skips" Detail formatting

Hi there,
I'm encountering an inexplicable problem with page formatting in
reports. Here's the easiest way to explain it:

The Detail section of my report contains two elements:
[unbound text box]
[DatabaseField]

And let's say I have the following VB code for the Detail_Format
event:
Me![unbound text box] = Me![unbound text box] + 1

The output of the report looks like this:

1
data item one
2
data item two
3
data item three
4
data item four

and so on...

This works fine unless a page break is encountered, in which case the
result actually looks like this:

1
data item one
2
data item two
3
data item three
---------Access inserts page break here--------
5
data item four

Apparently, Access "skips" a Detail_Format event. I've tried to trace
this and it appears that Access issues two Detail_Format events every
time it issues one Report_Page event, but somehow suppresses or
ignores the results from the first format event.

Has anyone else encountered this, and do you have any suggestions for
dealing with it?

Many thanks in advance for your wisdom,
-Eddy Bee

P.S. By the way, if I use Running Sum in the above example, it does
work correctly with page breaks. Unfortunately, the above example is
merely a simplified explanation of the problem - the actual formatting
requirements for my code are considerably more involved.
Nov 12 '05 #1
2 3869
When Access gets to the bottom of the page, it runs the Format event of the
detail section, discovers the page is not big enough, retreats, prints the
page, and runs the Format event *again* on the next page. The Retreat event
is probably your friend in this scenario. You may also need to check the
FormatCount argument.

However, the process you describe is not reliable enough to use. For
example, if you preview a report and jump to page 5 (or print only page 4),
the events may not run for the pages that were not previewed/printed. As a
result, we have found it unsafe to rely on event calculations that span
pages.

The running sum calculations are always reliable. Alternatively, perform the
calculation in the report's RecordSource (SQL expression) or in VBA. If the
code involves opening recordsets, the SQL solution (e.g. subquery) will be
more efficient.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Eddy Bee" <ed*****@yahoo.com> wrote in message
news:a5**************************@posting.google.c om...
Hi there,
I'm encountering an inexplicable problem with page formatting in
reports. Here's the easiest way to explain it:

The Detail section of my report contains two elements:
[unbound text box]
[DatabaseField]

And let's say I have the following VB code for the Detail_Format
event:
Me![unbound text box] = Me![unbound text box] + 1

The output of the report looks like this:

1
data item one
2
data item two
3
data item three
4
data item four

and so on...

This works fine unless a page break is encountered, in which case the
result actually looks like this:

1
data item one
2
data item two
3
data item three
---------Access inserts page break here--------
5
data item four

Apparently, Access "skips" a Detail_Format event. I've tried to trace
this and it appears that Access issues two Detail_Format events every
time it issues one Report_Page event, but somehow suppresses or
ignores the results from the first format event.

Has anyone else encountered this, and do you have any suggestions for
dealing with it?

Many thanks in advance for your wisdom,
-Eddy Bee

P.S. By the way, if I use Running Sum in the above example, it does
work correctly with page breaks. Unfortunately, the above example is
merely a simplified explanation of the problem - the actual formatting
requirements for my code are considerably more involved.

Nov 12 '05 #2
Thanks very much for the response, Allen.

What's strange is, my Retreat event procedures never seem to execute -
as if the events don't ever occur.

Thanks again,
-Eddy

"Allen Browne" <al*********@SeeSig.invalid> wrote in message news:<ND*******************@news-server.bigpond.net.au>...
When Access gets to the bottom of the page, it runs the Format event of the
detail section, discovers the page is not big enough, retreats, prints the
page, and runs the Format event *again* on the next page. The Retreat event
is probably your friend in this scenario. You may also need to check the
FormatCount argument.

However, the process you describe is not reliable enough to use. For
example, if you preview a report and jump to page 5 (or print only page 4),
the events may not run for the pages that were not previewed/printed. As a
result, we have found it unsafe to rely on event calculations that span
pages.

The running sum calculations are always reliable. Alternatively, perform the
calculation in the report's RecordSource (SQL expression) or in VBA. If the
code involves opening recordsets, the SQL solution (e.g. subquery) will be
more efficient.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

Nov 12 '05 #3

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

Similar topics

0
2463
by: Eric Wichterich | last post by:
Hello Pythonistas, does anyone know an equivalent python statement for perl's "next"-statement? (Perl's "next" skips a loop cycle and continues with the next loop cycle - it does not abort the...
8
1816
by: Remy Blank | last post by:
Hello unittest users, In a project I am working on, I have a series of tests that have to be run as root, and others as a normal user. One solution is to separate the tests into two different...
9
2733
by: shannonl | last post by:
Hi all, For some reason this bind is calling the donothing function, like it should, but is then allowing the text to be inserted into the Text widget. Here is the code: ...
10
17183
by: Mart | last post by:
What class does everyone out there use if they want to store a set of values efficiently? In java I use a HashSet, but there is no equivalent in C#. Even worse, the lowest level interface to...
7
19937
by: Przemo Drochomirecki | last post by:
hi, SCANF is not well described in my books, i'd like to do this stuff: 1) read all numbers from a line, separated by #32 2) read all numbers from a line, separaed by ',' 3) read whole line ...
14
2705
by: Peter Mount | last post by:
Hello I'm having trouble with " scanf("%c", &answer);" on line 20 below. When I run the program in cygwin on Windows 98SE it skips that line completely and ends the program. Does scanf have...
10
2368
by: thomson | last post by:
Hi, i create a session variable in C# as follows Session , but iam not able to access the variable in VB.net like intmode=Session("var"); Why is that ? Regards
11
11098
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
3
2232
by: Patrick Sullivan | last post by:
In this for loop, IE skips over the animation function until the end of the loop and only aninmates the last phrase. Firefox does it right. Loop is right below, entire script is below that. This...
0
7229
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
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7333
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,...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.