ReportBottomAligned
Updated On: 27-Dec-2011
Explanatory Notes
This sample db demonstrates bottom alignment of text in various text boxes in an access report. It involves dynamic adjustment of top margins in such a manner that for each record, grown height of each text box in the detail section matches that of the tallest one, at the same time ensuring uniform bottom alignment.
Two styles of
report with bottom alignment of text are covered:
(a) Simple - Without grid lines.
(b) With grid lines - Spreadsheet style
Except for the name of row counter text box, generic code is used so as to automatically suit any number and nomenclature of controls.
While drawing vertical grid lines in style (b) above, the locations are set programmatically in such a manner as to fall mid-way between adjacent controls.
For optimum effect, it has been ensured that top margin of first control displaying row numbers is dynamically kept identical to that of next adjoining control.
Note:
This update overcomes the need to navigate through
each page of report so as to fetch grown heights of controls as revealed in
print event, thereby eliminating dependence upon either SendKeys method or
Stephen Leban's API based page turner function. It is understood that
SendKeys stands broken in Windows 7 while Leban's function fails to work in
Access 2010. Instead, Setting report's MoveLayout property to false in first
stage opening of report, as used in this version is found most dependable as
it shrinks the report to a single page, ensuring that print events for all
records get fired without having to move away from first page.
Version: Access 2000 File Format
Reference: DAO 3.6