Setting number of lines in detail section

A

Al

Hi, all!

Using Acces 2K/2K2 - grouped report.

How can I set the detail section to always show say 20 lines even
though there may be anywhere from 1 to 19 records in a particular
group. In other words, if I have 5 records in a group, I'd like to
show those five records plus 15 "blank" lines.

Thanks!
Al
 
D

Duane Hookom

If I understand correctly, you want to draw 20 horizontal lines on a report
page and print records on the lines for as many as your record count. Is
that correct?

What happens if you have more than 20 records?
 
A

Al

Thanks, Duane

Yes - your understanding is correct. If there are more than 20
records, the report forces them to subsequent pages - IOW the detail
section is sized for no more than 20.

Can I get piggy and ask for a suggestion as how to number the lines -
real records and added lines as well?

Thanks again.
Al
 
D

Duane Hookom

Remove any line controls that you might have been using to underline
records. Add this code to the On Page event of your report. This code
assumes Report Header and Page Header sections. You may need to remove one
or the other. You may also want to adjust the currentX and CurrentY calcs.

Private Sub Report_Page()
Dim intRptHeadHeight As Integer
Dim intPageHeadHeight As Integer
Dim intTopMarg As Integer
Dim intDetailHeight As Integer
Dim intRecNum As Integer
intRptHeadHeight = Me.ReportHeader.Height
intPageHeadHeight = Me.Section(3).Height
intTopMarg = intRptHeadHeight + intPageHeadHeight
intDetailHeight = Me.Section(0).Height
For intRecNum = 1 To 20
Me.CurrentX = 200
Me.CurrentY = intTopMarg + _
((intRecNum - 1) * intDetailHeight)
Me.Print intRecNum
Me.Line (0, intTopMarg + _
(intRecNum * intDetailHeight)) _
-Step(Me.Width, 0)
Next
End Sub

--
Duane Hookom
MS Access MVP
--

Al said:
Thanks, Duane

Yes - your understanding is correct. If there are more than 20
records, the report forces them to subsequent pages - IOW the detail
section is sized for no more than 20.

Can I get piggy and ask for a suggestion as how to number the lines -
real records and added lines as well?

Thanks again.
Al
 
A

Al

Howdy, Duane!

This code helped me greatly - I still have some refinements to do, but
this is a good roadmap. Thanks!!!!

Al
 

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