-----Original Message-----
I hate to be so dumb, but where do you put the code to
force a page break. I clicked on the Page break icon and
then drew a box with the resulting croshair. Then after
selecting that I clicked on the "code" icon and entered
the code you indicated. After that, in print preview the
page was blank. I think I should have entered the code
somewhere else. ??? Can you tell me each step?
Thank you!
Re: > I clicked on the Page break icon and
then drew a box with the resulting croshair. <
What Box? The PageBreak is a very short (about 1/2 inch) dotted line
at the left side of the section.
Open the Report in design View.
Delete the code you have entered.
Click on the ToolBox tool button.
Click on the Page Break button.
Drag it onto the TOP of the Detail Section (above the first row of
controls in that section).
Take note of the Page Break name.
Right-click anywhere in an empty section of the Detail section.
Display the property sheet. Click on the Event tab.
On the Line that says OnFormat write [Event Procedure].
Then click on the button with the 3 dots that will appear on that
line.
The Code window will open with the cursor flashing between two already
existing lines. Type the code I gave you BETWEEN those 2 lines.
Where I have written [PageBreakName] you will write the actual name of
your page break (i.e. PageBreak123).
When done, your code should look like this:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Static intX As Integer
[PageBreakName].Visible = False
If [Month] = 6 Then intX = intX + 1
If intX = 1 And [Month] = 6 Then
[PageBreakName].Visible = True
End If
End Sub
Exit the code window by clicking on the Close button.
Run the report.
** snipped **
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.