Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Access 07 VBA GrpFtrLoc problem

$
0
0
Hi - need some assistance adapting code for setting the report footer at the same place on page 1 of report........

These are invoices - each report is exactly the same number of controls, hdr, ftr, groups, expressions, etc.
Similar qry record sources.

The reports have a count of records in the report footer

I pulled this out of MSDN:
It says to use it for either Page Footer or Report Footer

1st step - the Module
MODULE: REPORTFOOTER
Sub SetGrpFtrLoc(Rpt As Report, GrpFtrLoc As Double)
GrpFtrLoc = GrpFtrLoc * 1440 'Convert from inches to twips.
If Rpt.Top < GrpFtrLoc Then 'Not at location yet, so
Rpt.MoveLayout = True 'move to next print location.
Rpt.NextRecord = False 'Do not go to next record.
Rpt.PrintSection = False 'Do not print the section.
End If 'Until the required offset is reached

End Sub

2nd step - the report
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Call SetGrpFtrLoc(Me.Report, 6) 'Display report footer at least
'6 inches from the top of the page

End Sub


I'm getting unexpected results........I have this code in 2 different reports right now.
One report returns correctly if there are multiple records, if there is a single record the report footer is no where to be found. It is so many pages in print preview the report never stops formatting

The other report is exact opposite - correct on single record, multiple records generate uncountable number of pages where the report footer is

Do I need something to tell VBA it is only 1 page?
Any ideas?

Viewing all articles
Browse latest Browse all 13329

Trending Articles