Vertical spacing in report

  • Thread starter Thread starter Sandra
  • Start date Start date
S

Sandra

I need to make the space smaller between lines of my
report. Don't have any idea how.

Also, the report has data for 12 months of the year for
five years. For example:
Month Year Amount
1 2000 3,222
1 2001 6,255
1 2002 7,555
1 2003 6,555
1 2004 5,666

2 2000 2,555
2 2001 3,555

Etc.

I need to force a page break after month 6.

Any ideas?
 
I need to make the space smaller between lines of my
report. Don't have any idea how.

1) Make the height of the controls on the line just tall enough to
display the text without cutting off the bottoms of the characters
that dip below the line, i.e. jgy_ etc.
The actual height will depend upon the font size used.

2) Close up the height of the detail section so there is very little
blank space under the bottom row of controls.
Also, the report has data for 12 months of the year for
five years. For example:
Month Year Amount
1 2000 3,222
1 2001 6,255
1 2002 7,555
1 2003 6,555
1 2004 5,666

2 2000 2,555
2 2001 3,555

Etc.

I need to force a page break after month 6.

Any ideas?

Add a Page Break control to the TOP OF the detail section (if that is
where this is showing).
Code the Detail Format event:

Air code....
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

The above should force a page break just before the first Month 6
record.

Note: If you really do have fields named Month and Year it would be
advisable to change their names to something else, perhaps "txtMonth'
or 'txtYear'. Month and Year are reserved words in Access/VBA and
should not be used as field names.
 
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!
-----Original Message-----
I need to make the space smaller between lines of my
report. Don't have any idea how.

1) Make the height of the controls on the line just tall enough to
display the text without cutting off the bottoms of the characters
that dip below the line, i.e. jgy_ etc.
The actual height will depend upon the font size used.

2) Close up the height of the detail section so there is very little
blank space under the bottom row of controls.
Also, the report has data for 12 months of the year for
five years. For example:
Month Year Amount
1 2000 3,222
1 2001 6,255
1 2002 7,555
1 2003 6,555
1 2004 5,666

2 2000 2,555
2 2001 3,555

Etc.

I need to force a page break after month 6.

Any ideas?

Add a Page Break control to the TOP OF the detail section (if that is
where this is showing).
Code the Detail Format event:

Air code....
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

The above should force a page break just before the first Month 6
record.

Note: If you really do have fields named Month and Year it would be
advisable to change their names to something else, perhaps "txtMonth'
or 'txtYear'. Month and Year are reserved words in Access/VBA and
should not be used as field names.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
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 **
 
Thank you Fred! This was VERY helpful. I couldn't get
the code to work, but I entered some other code that did,
after you showed me step by step where to put it. I had
no idea, and was floundering in the dark. Thanks for
getting down to the basics!

Sandra
-----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.
.
 
Back
Top