Printing Blank Records to Complete a Report

  • Thread starter pu5 via AccessMonster.com
  • Start date
P

pu5 via AccessMonster.com

I need to create a report that completes a page with blank records. I have
the report set up so that detail fields print with borders. There need to be
(12) lines of detail records printed regardless of data (i.e., 2 actual
records - print 10 blank, etc.). I used field borders so that I would also
get vertical lines.

Can anyone provide help for this?
 
D

Duane Hookom

You might want to remove the borders from all controls and use code to draw
the boxes. The following code in the On Page event of the report might work
for you.

Private Sub Report_Page()
Dim intNumLines As Integer
Dim intLineNumber As Integer
Dim intTopMargin As Integer
Dim ctl As Control
Dim intLineHeight As Integer
intNumLines = 12
intTopMargin = Me.Section(3).Height
intLineHeight = Me.Section(0).Height
For Each ctl In Me.Section(0).Controls
For intLineNumber = 0 To intNumLines - 1
Me.Line (ctl.Left, intTopMargin + _
(intLineNumber * intLineHeight)) _
-Step(ctl.Width, intLineHeight), , B
Next
Next
End Sub
 
P

pu5 via AccessMonster.com

Thanks for the feedback. I tried this but it overlays on my report. How do
I make this occur after the last record of the Detail section?

Duane said:
You might want to remove the borders from all controls and use code to draw
the boxes. The following code in the On Page event of the report might work
for you.

Private Sub Report_Page()
Dim intNumLines As Integer
Dim intLineNumber As Integer
Dim intTopMargin As Integer
Dim ctl As Control
Dim intLineHeight As Integer
intNumLines = 12
intTopMargin = Me.Section(3).Height
intLineHeight = Me.Section(0).Height
For Each ctl In Me.Section(0).Controls
For intLineNumber = 0 To intNumLines - 1
Me.Line (ctl.Left, intTopMargin + _
(intLineNumber * intLineHeight)) _
-Step(ctl.Width, intLineHeight), , B
Next
Next
End Sub
I need to create a report that completes a page with blank records. I have
the report set up so that detail fields print with borders. There need to be
[quoted text clipped - 3 lines]
Can anyone provide help for this?
 
D

Duane Hookom

It is supposed to "overlay" your report with boxes. Did you remove the
borders from your existing controls?

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
Thanks for the feedback. I tried this but it overlays on my report. How do
I make this occur after the last record of the Detail section?

Duane said:
You might want to remove the borders from all controls and use code to draw
the boxes. The following code in the On Page event of the report might work
for you.

Private Sub Report_Page()
Dim intNumLines As Integer
Dim intLineNumber As Integer
Dim intTopMargin As Integer
Dim ctl As Control
Dim intLineHeight As Integer
intNumLines = 12
intTopMargin = Me.Section(3).Height
intLineHeight = Me.Section(0).Height
For Each ctl In Me.Section(0).Controls
For intLineNumber = 0 To intNumLines - 1
Me.Line (ctl.Left, intTopMargin + _
(intLineNumber * intLineHeight)) _
-Step(ctl.Width, intLineHeight), , B
Next
Next
End Sub
I need to create a report that completes a page with blank records. I have
the report set up so that detail fields print with borders. There need to be
[quoted text clipped - 3 lines]
Can anyone provide help for this?
 
P

pu5 via AccessMonster.com

Sorry, I wasn't cleasr with my original posting. The report appears like a
Form/Subform. The top of the report is a header. The detail information is
where I need the blank fields.
_______________
| Header |
| Portion |
|_______________|
|____|___|___|____|
|____|___|___|____|
|_______________|
|_______________|

For this "picture", there are (2) "subform" records so I would need (10)
lines of blank. There will always be a total of (12).

Duane said:
It is supposed to "overlay" your report with boxes. Did you remove the
borders from your existing controls?
Thanks for the feedback. I tried this but it overlays on my report. How do
I make this occur after the last record of the Detail section?
[quoted text clipped - 26 lines]
 
D

Duane Hookom

I can kinda see how you want the lines to draw on the report. How does the
code I provided not meet your requirements? What needs to be modified? Do you
not want the vertical lines in the extra rows where there are no records?


--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
Sorry, I wasn't cleasr with my original posting. The report appears like a
Form/Subform. The top of the report is a header. The detail information is
where I need the blank fields.
_______________
| Header |
| Portion |
|_______________|
|____|___|___|____|
|____|___|___|____|
|_______________|
|_______________|

For this "picture", there are (2) "subform" records so I would need (10)
lines of blank. There will always be a total of (12).

Duane said:
It is supposed to "overlay" your report with boxes. Did you remove the
borders from your existing controls?
Thanks for the feedback. I tried this but it overlays on my report. How do
I make this occur after the last record of the Detail section?
[quoted text clipped - 26 lines]
Can anyone provide help for this?
 
P

pu5 via AccessMonster.com

No the grid that it printed was fine; however, I need it to start at the end
of the subform records and not overlay the entire report (Header). The
vertical lines are fine.

Duane said:
I can kinda see how you want the lines to draw on the report. How does the
code I provided not meet your requirements? What needs to be modified? Do you
not want the vertical lines in the extra rows where there are no records?
Sorry, I wasn't cleasr with my original posting. The report appears like a
Form/Subform. The top of the report is a header. The detail information is
[quoted text clipped - 19 lines]
 
D

Duane Hookom

Try change the intTopMargin to include a report header

intTopMargin = Me.Section(3).Height + Me.Section(1).Height

Sections of your report are numbered
0 detail section
1 Report Header
2 Report Footer
3 Page Header
4 Page Footer
5 --- start of group headers and footers ----


--
Duane Hookom
MS Access MVP
Help me support UCP http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
No the grid that it printed was fine; however, I need it to start at the
end
of the subform records and not overlay the entire report (Header). The
vertical lines are fine.

Duane said:
I can kinda see how you want the lines to draw on the report. How does the
code I provided not meet your requirements? What needs to be modified? Do
you
not want the vertical lines in the extra rows where there are no records?
Sorry, I wasn't cleasr with my original posting. The report appears
like a
Form/Subform. The top of the report is a header. The detail
information is
[quoted text clipped - 19 lines]
Can anyone provide help for this?
 
D

Duane Hookom

I'm not sure you are understanding that if the draw lines are expected to
start on the page where the actual records leave off, I am not aware of how
to do this. That is why my code is designed to start creating lines exactly
where the first record on the report appears.

Generally, removing all borders from controls and applying consistent
lines/rectangles over printed records and extra spaces works.

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
No the grid that it printed was fine; however, I need it to start at the end
of the subform records and not overlay the entire report (Header). The
vertical lines are fine.

Duane said:
I can kinda see how you want the lines to draw on the report. How does the
code I provided not meet your requirements? What needs to be modified? Do you
not want the vertical lines in the extra rows where there are no records?
Sorry, I wasn't cleasr with my original posting. The report appears like a
Form/Subform. The top of the report is a header. The detail information is
[quoted text clipped - 19 lines]
Can anyone provide help for this?
 
P

pu5 via AccessMonster.com

Ok, thanks for your help. The problem is that the report borders are not
uniform and consistant (over the entire report). The borders on the Detail
section are consistent but not on the Header.

Duane said:
I'm not sure you are understanding that if the draw lines are expected to
start on the page where the actual records leave off, I am not aware of how
to do this. That is why my code is designed to start creating lines exactly
where the first record on the report appears.

Generally, removing all borders from controls and applying consistent
lines/rectangles over printed records and extra spaces works.
No the grid that it printed was fine; however, I need it to start at the end
of the subform records and not overlay the entire report (Header). The
[quoted text clipped - 9 lines]
 
D

Duane Hookom

I don't know what you mean by "borders are not uniform and consistant (over
the entire report)". What are you reffering to with the term "borders". Do
you actually mean section heights? Can you be more specific?

There are a couple lines in the code that set the top margin. This allows
you to accommodate Report and Page Header heights.

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
Ok, thanks for your help. The problem is that the report borders are not
uniform and consistant (over the entire report). The borders on the Detail
section are consistent but not on the Header.

Duane said:
I'm not sure you are understanding that if the draw lines are expected to
start on the page where the actual records leave off, I am not aware of how
to do this. That is why my code is designed to start creating lines exactly
where the first record on the report appears.

Generally, removing all borders from controls and applying consistent
lines/rectangles over printed records and extra spaces works.
No the grid that it printed was fine; however, I need it to start at the end
of the subform records and not overlay the entire report (Header). The
[quoted text clipped - 9 lines]
Can anyone provide help for this?
 
P

pu5 via AccessMonster.com

Is there a way I can email (attach) the form to you so that you see what I am
describing?

Duane said:
I don't know what you mean by "borders are not uniform and consistant (over
the entire report)". What are you reffering to with the term "borders". Do
you actually mean section heights? Can you be more specific?

There are a couple lines in the code that set the top margin. This allows
you to accommodate Report and Page Header heights.
Ok, thanks for your help. The problem is that the report borders are not
uniform and consistant (over the entire report). The borders on the Detail
[quoted text clipped - 13 lines]
 
D

Duane Hookom

I'm not sure why you can't describe your report sections, heights, and where
the draw lines begin printing on the page.

You have mentioned "form" more than once. Can we assume you are printing a
report and not a form? Is the a subreport in your report?

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
Is there a way I can email (attach) the form to you so that you see what I am
describing?

Duane said:
I don't know what you mean by "borders are not uniform and consistant (over
the entire report)". What are you reffering to with the term "borders". Do
you actually mean section heights? Can you be more specific?

There are a couple lines in the code that set the top margin. This allows
you to accommodate Report and Page Header heights.
Ok, thanks for your help. The problem is that the report borders are not
uniform and consistant (over the entire report). The borders on the Detail
[quoted text clipped - 13 lines]
Can anyone provide help for this?
 
P

pu5 via AccessMonster.com

This report prints similar to a form/subform (in my opinion). There are the
following sections...
PageHeaderSection = 0.333"
GroupHeader0 = 4.2083"
Detail = 0.4167"
PageFooterSection = 0.3333"

The GroupHeader0 and Detail sections obviously have significanlty different
layouts (based on the size). The GroupHeader0 contains "non-uniform" lines
and borders. The Detail section contains (4) fields (Tasks, Responsibility,
CompletionTiming & Comments) displayed in a spreadsheet type format.
Originally I had borders print around each of these fields. To match a
"Company" form, I need the detail section to print (12) rows regardless of
the number of Tasks. There may only be (2) actual rows of Detail data; so, I
need (10) additional rows of blank spreadsheet/boxes to fill the page. If
there were (5) actual rows of Detail data I would then need (5) additional
rows of blank spreadsheet/boxes to fill the page.

Hope this is clearer.


Duane said:
I'm not sure why you can't describe your report sections, heights, and where
the draw lines begin printing on the page.

You have mentioned "form" more than once. Can we assume you are printing a
report and not a form? Is the a subreport in your report?
Is there a way I can email (attach) the form to you so that you see what I am
describing?
[quoted text clipped - 11 lines]
 
D

Duane Hookom

Have you attempted to adjust the intTopMargin to account for your Group
Header? Do you only have one group header per page?

What is your final code? We can't see the lines that are being printed so
you have to tell us if they are too high or low or what.

Can you please understand that I am not smart enough to write code that
-determines how many records will print on the page
-calculate where the records (details) will stop on the page
-subtract the number of records from 12
-finish the page by drawing 12-recordcount extra blanks

I can only tell you how to print 12 sets of lines on your page beginning at
the same place on each page. The place the lines/boxes begin is set in the
code.

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
This report prints similar to a form/subform (in my opinion). There are the
following sections...
PageHeaderSection = 0.333"
GroupHeader0 = 4.2083"
Detail = 0.4167"
PageFooterSection = 0.3333"

The GroupHeader0 and Detail sections obviously have significanlty different
layouts (based on the size). The GroupHeader0 contains "non-uniform" lines
and borders. The Detail section contains (4) fields (Tasks, Responsibility,
CompletionTiming & Comments) displayed in a spreadsheet type format.
Originally I had borders print around each of these fields. To match a
"Company" form, I need the detail section to print (12) rows regardless of
the number of Tasks. There may only be (2) actual rows of Detail data; so, I
need (10) additional rows of blank spreadsheet/boxes to fill the page. If
there were (5) actual rows of Detail data I would then need (5) additional
rows of blank spreadsheet/boxes to fill the page.

Hope this is clearer.


Duane said:
I'm not sure why you can't describe your report sections, heights, and where
the draw lines begin printing on the page.

You have mentioned "form" more than once. Can we assume you are printing a
report and not a form? Is the a subreport in your report?
Is there a way I can email (attach) the form to you so that you see what I am
describing?
[quoted text clipped - 11 lines]
Can anyone provide help for this?
 
P

pu5 via AccessMonster.com

That's it. Adjusting the intTopMargin did it (with a little trial and error).
Thanks again for your help.


Duane said:
Have you attempted to adjust the intTopMargin to account for your Group
Header? Do you only have one group header per page?

What is your final code? We can't see the lines that are being printed so
you have to tell us if they are too high or low or what.

Can you please understand that I am not smart enough to write code that
-determines how many records will print on the page
-calculate where the records (details) will stop on the page
-subtract the number of records from 12
-finish the page by drawing 12-recordcount extra blanks

I can only tell you how to print 12 sets of lines on your page beginning at
the same place on each page. The place the lines/boxes begin is set in the
code.
This report prints similar to a form/subform (in my opinion). There are the
following sections...
[quoted text clipped - 27 lines]
 
P

pu5 via AccessMonster.com

Sorry...one other question. Is there a way to change Line thickness?

Duane said:
Have you attempted to adjust the intTopMargin to account for your Group
Header? Do you only have one group header per page?

What is your final code? We can't see the lines that are being printed so
you have to tell us if they are too high or low or what.

Can you please understand that I am not smart enough to write code that
-determines how many records will print on the page
-calculate where the records (details) will stop on the page
-subtract the number of records from 12
-finish the page by drawing 12-recordcount extra blanks

I can only tell you how to print 12 sets of lines on your page beginning at
the same place on each page. The place the lines/boxes begin is set in the
code.
This report prints similar to a form/subform (in my opinion). There are the
following sections...
[quoted text clipped - 27 lines]
 
D

Duane Hookom

You can adjust the line width with code like:
Me.DrawWidth = 10
This must be coded prior to the line method.
--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


pu5 via AccessMonster.com said:
Sorry...one other question. Is there a way to change Line thickness?

Duane said:
Have you attempted to adjust the intTopMargin to account for your Group
Header? Do you only have one group header per page?

What is your final code? We can't see the lines that are being printed so
you have to tell us if they are too high or low or what.

Can you please understand that I am not smart enough to write code that
-determines how many records will print on the page
-calculate where the records (details) will stop on the page
-subtract the number of records from 12
-finish the page by drawing 12-recordcount extra blanks

I can only tell you how to print 12 sets of lines on your page beginning at
the same place on each page. The place the lines/boxes begin is set in the
code.
This report prints similar to a form/subform (in my opinion). There are the
following sections...
[quoted text clipped - 27 lines]
Can anyone provide help for this?
 
P

pu5 via AccessMonster.com

That's great...all is working fine. Again, thanks for your help and patience.



Duane said:
You can adjust the line width with code like:
Me.DrawWidth = 10
This must be coded prior to the line method.
Sorry...one other question. Is there a way to change Line thickness?
[quoted text clipped - 19 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top