Conditional Adding of Blank Records in a Report

  • Thread starter Randy via AccessMonster.com
  • Start date
R

Randy via AccessMonster.com

I am attempting to generate a report that will create blank records/space
based on the number of actual detail records. The report will have a
Report/Page Header(s), Details and a Report/Page Footer(s). I need to
generate a maximum of (15) detail records. If there are only (6) records
in the sub-form, I need for the report to generate an additional (9) blank
records to fill the remaining space on the form.

I would appreciate any assistance.
 
D

Duane Hookom

How do you define "blank record"? What does "subform" have to do with your
question?
 
R

Randy via AccessMonster.com

Sorry for the confusion...

My report is based on a query of (2) linked tables. The primary tbl
contains a Doc Number, Vendor, Address, etc. The secondary tbl contains
items purchased per the Doc Number. In the form and report the secondary
information is in a datasheet view. If there are (6) secondary items I
need to display and print (15)...obviously (9) are blank. If there are (13)
secondary records for a Doc No. then I would only need (2) blank lines.
 
D

Duane Hookom

Do you start a new page for each Doc?

I think you can use the Line Method of the report on the Page event.
 
R

Randy via AccessMonster.com

Thanks for the responses...

1. Yes, we do start a new page for each document.

2. Could you elaborate on the "Line Method of the report??
 
D

Duane Hookom

The following is a sample of code that draws up to 24 horizontal lines in a
report page. You can comment out the Me.Print... line to prevent the
printing of the line number.
Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin As Integer
Dim intDetailHeight As Integer
intRows = 24
intDetailHeight = Me.Section(0).Height
intTopMargin = 360
Me.FontSize = 16
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub
 

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