Re: Show detail rows in report with or without data using VBA?
- From: "Duane Hookom" <duanehookom@xxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Jan 2006 16:28:31 -0600
"How do I configure this code so that it will effect only the detail
section?" You tell me want doesn't work with the code that I provided. Also
let us know what you might have tried to adjust the code.
--
Duane Hookom
MS Access MVP
--
"Tec92407" <Tec92407@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:53BB50BB-D799-4171-AEA9-52978CA24BA7@xxxxxxxxxxxxxxxx
> Thanks
> Your is a simpler aproach.
>
> My report has a header, detail and footer sections.
> The header and footer always have data. The number of rows containing data
> in the detail section may vary from 1 to 10, but I want 10 rows to always
> be
> printed.
>
> What i want to accomplish is have the header printed, then the detail rows
> followed by a number of empty (filler) rows to complete the detail rows to
> 10, then the footer section.
>
> How do I configure this code so that it will effect only the detail
> section?
>
> thanks
> "Duane Hookom" wrote:
>
>> If you want 10 lines on each page, consider code like the following:
>> 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 10
>> 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
>> --
>>
>> "Tec92407" <Tec92407@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:40A5255D-70A4-439E-B469-372FCE5DC9A3@xxxxxxxxxxxxxxxx
>> >I have a report that has a similar look to an existing paper form. The
>> >paper
>> > form has ten numbered rows of empty line items that are later filled in
>> > with
>> > data as needed. My Access version of this report looks identical to the
>> > paper
>> > form except that the item rows (detail section) only appear if there is
>> > data
>> > (as expected).
>> >
>> > Is there a way to create the report so that the ten empty rows appear
>> > but
>> > get
>> > populated with data as needed? So that the report always shows ten
>> > rows,
>> > either empty or with data?
>> >
>> > I think there is a way withe VBA. If the report has 3 detail records, I
>> > think this is the vba approach I would use (excuse my psuedo code) : -)
>> >
>> > In the "on print" event procedure of the detail section of the report:
>> >
>> > If the record count in the detail section is less than 10
>> > for each field in the detail row
>> > get the property values for the outline of each field
>> > end
>> >
>> > get the detail record count
>> > subtract detail record count from 10
>> >
>> > while count is less than the computed count
>> > for each field in the row
>> > draw each field outline
>> > end
>> > end
>> >
>> > end
>> >
>> > Is this the right approach or is there an easier way to do this?
>> > Anyone have code to share?
>> >
>> > Thanks in advance
>>
>>
>>
.
- Follow-Ups:
- References:
- Re: Show detail rows in report with or without data using VBA?
- From: Duane Hookom
- Re: Show detail rows in report with or without data using VBA?
- From: Tec92407
- Re: Show detail rows in report with or without data using VBA?
- Prev by Date: Re: Displaying filter/condition info on report
- Next by Date: Re: Displaying filter/condition info on report
- Previous by thread: Re: Show detail rows in report with or without data using VBA?
- Next by thread: Re: Show detail rows in report with or without data using VBA?
- Index(es):
Relevant Pages
|