Force a query to contain 20 records

J

John S

Hello all,

I was wondering if you all could help me out with a
problem that I am having. I am trying to create a report
that will show 20 records per page. To do that I think
that I have to set up a query that automatically forces
itself to have at least 20 lines of output.

Is there any way that I can force a query to show 20 lines
of output even if the recordsource only has 5 lines. The
other 15 lines would then be all blanks, or zero's.

Any help would be greatly appreciated.

Thanks
 
G

GreySky

Yes. One method is:

--Have a blank table that contains 20 records. Have the
fields be identical to the output of the main query. Have
a field that counts each row -- numbered from 1 to 20.

Something like:
tblBlankTableCounters
BlankTableCounterID Field1 Field2
1
2
3
....
20

--Have a little query that returns the count of the main
query.

--Create a query that takes the "blanks" table, uses the
query that contains the count of the main table, and have
it return the number of rows neeeded to flush it out to 20
lines. To do this, use a where statement to the effect
of: BlankTableCounterID <=
(qryTotalMainQueryRows.CountOfRealRows Mod 20)

--Union the main query with the blanks query.

David Atkins, MCP
 
J

John M

What do you mean, Other ways to draw lines in reports?
Cause that is essentially exactly what I am trying to do.

Please help
 
G

GreySky

The following prints a 3 inch vertical line. Look up Line
for usage.

Private Sub Report_Page()
Line (0, 0)-(0, 3 * 1440)
End Sub


David Atkins, MCP
 

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