By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,461 Members | 1,120 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,461 IT Pros & Developers. It's quick & easy.

Pad lines on a report

P: n/a
I can swear I saw an answer to this a while back but can't locate it.

I need to pad lines on a report (print 20 lines, even if there are only 15
records - the last 5 lines blank).

Any suggestion appreciated.

--
Randy Harris
(tech at promail dot com)
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Here's an outline of what I used ---------------
Data for my report comes from a query. The query includes the primary key
and five fields from a table.
1. Create TblBlankLine:
TblBlankLine
ARow
A1
A2
A3
A4
A5
Set ARow data type to long integer and A1 to A5 data types to match the
data types of the fields in the query. ARow is numbered 5000001 to 5000028
2. I needed a total of 28 records and blank lines in my report. Put the
following in a standard module:
Function BlankLines()
Dim Items As Integer
Items = DCount("*", "MyQuery")
BlankLines = 28 - Items
End Function
3. Union MyQuery with TblBlankLine and include the Where clause:
WHERE TblBlankLine.ARow<=(BlankLines()+5000000)
4. Put the following in the ReportHeader_Format event:
Call BlankLines

When the report opens, BlankLines is calculated. The Union query returns 28
records; whatever number of records from MyQuery and the remainder as blank
lines. Note that the fields in the report must show their borders.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Randy Harris" <ra***@SpamFree.com> wrote in message
news:tg*****************@newssvr31.news.prodigy.co m...
I can swear I saw an answer to this a while back but can't locate it.

I need to pad lines on a report (print 20 lines, even if there are only 15
records - the last 5 lines blank).

Any suggestion appreciated.

--
Randy Harris
(tech at promail dot com)

Nov 13 '05 #2

P: n/a
Thanks, I knew I'd seen a sample of how to accomplish that recently. What I
neglected to mention, however, is that the RecordSource for the report is an
ODBC pass-thru query. I'm not sure if I can union TblBlankLine to it. Have
to give it a try.

Thanks again,
--
Randy Harris
(tech at promail dot com)
"PC Datasheet" <no****@nospam.spam> wrote in message
news:ZS****************@newsread2.news.atl.earthli nk.net...
Here's an outline of what I used ---------------
Data for my report comes from a query. The query includes the primary key
and five fields from a table.
1. Create TblBlankLine:
TblBlankLine
ARow
A1
A2
A3
A4
A5
Set ARow data type to long integer and A1 to A5 data types to match the data types of the fields in the query. ARow is numbered 5000001 to 5000028
2. I needed a total of 28 records and blank lines in my report. Put the
following in a standard module:
Function BlankLines()
Dim Items As Integer
Items = DCount("*", "MyQuery")
BlankLines = 28 - Items
End Function
3. Union MyQuery with TblBlankLine and include the Where clause:
WHERE TblBlankLine.ARow<=(BlankLines()+5000000)
4. Put the following in the ReportHeader_Format event:
Call BlankLines

When the report opens, BlankLines is calculated. The Union query returns 28 records; whatever number of records from MyQuery and the remainder as blank lines. Note that the fields in the report must show their borders.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Randy Harris" <ra***@SpamFree.com> wrote in message
news:tg*****************@newssvr31.news.prodigy.co m...
I can swear I saw an answer to this a while back but can't locate it.

I need to pad lines on a report (print 20 lines, even if there are only 15 records - the last 5 lines blank).

Any suggestion appreciated.

--
Randy Harris
(tech at promail dot com)


Nov 13 '05 #3

P: n/a
Randy Harris wrote:
Thanks, I knew I'd seen a sample of how to accomplish that recently. What I
neglected to mention, however, is that the RecordSource for the report is an
ODBC pass-thru query. I'm not sure if I can union TblBlankLine to it. Have
to give it a try.


If possible, put a tblBlankline on the server and union it there, it'll
be better than a heterogeneous query.

Otherwise tblBlankLine in the local db and union your passthrough query
with that, e.g.
select * from passthroughquery union ALL select * from tblBlankline
As opposed to trying anything else within the passthrough query itself.

Note the ALL keyword in the union, unions usually elimiate duplicates,
you won't have duplicates so no need toi waste time/resources
eliminating them.

--
This sig left intentionally blank
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.