Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Continued on Page 2 on Report

Introduction

Normally, MS-Access Reports can run into several pages and it is a custom to give page numbers on each page along with the total number of pages as an indicator.  To prepare this a Text Box is added at the  Page Footer of the Report and an expression like the following is entered into the Control Source property:

=”Page “ & [page] & “ of “ & [pages]

Result: Page 1 of 15

OR

=”Page: “ & [page] & “ / “ & [pages]

Result: Page: 1 / 15

Report Date is also added in the page footer area like =”Date: “ & format(date(),”dd/mm/yyyy”)

We keep writing these expressions repeatedly every time when a new report is designed.  If you are a VBA enthusiast and using VBA routines in your applications then these kind of actions can be automated with the use of User-Defined Functions and call the function from the Text Box's Control Source property to quickly insert these information on the Report.  I have written two functions for this purpose and if you are interested to take a look at them then click here.

When you are working with VBA routines in Standard Modules or Class Modules you can see that certain group of statements or actions repeated at different places, which are useful across different Applications.  They can be customized and written in the form of public functions and added to your User-Defined Function Library so that they can be called with one line statement.  The lengthy VBA Routines can be compressed this way.  There is a Blog Post related to this topic: MS-Access and Reference Library.

Coming back to the Page indicator topic we will try to display the page information in the Page Footer of the Report with a difference.  The Report can be a single page one or can have several pages. When the Report have more than one page then on the first page footer the following label should appear: Continued on Page 2.

On next page (i.e on page 2) Continued on Page 3 and so on till the last but one page.  This label should not appear at the last page.  If the report has only one page then this label should not appear at all.

With the first example given at the top of this Article the Report with only one page will print as Page 1 of 1.


Try out the Page Footer Setting

  1. To try our new page labels; open one of your Reports with few pages.
  2. Create a Text Box, wide enough to display the label; like Continued on Page 99; at the Page Footer of the Report.
  3. Write the following expression in the Control Source Property of the Text Box.
  4. =IIf([Pages]>1 And [Page]<[Pages],"Continued on Page " & [Page]+1,"")
  5. Save the Report and open it in Print Preview.
  6. Check the last page of the Report.  This label should not appear there.
  7. Try this out on a single page Report.

NB: [page], [pages] are System Variables and they should be used in the expression without change. &hypen;

Share:

No comments:

Post a Comment

Comments subject to moderation before publishing.

MS-Access Tips on your Finger-Tip

  • Download Android App 'MSA Guru' Version of LEARN MS-ACCESS TIPS AND TRICKS from Google Play Store.

Want to Post Free Ads on the Web


Translate



PageRank
Subscribe in a reader
Your email address:

Delivered by FeedBurner

Search

Popular Posts

Blog Archive

Powered by Blogger.

Follow by Email

Labels

Forms Functions How Tos MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Class Module External Links Queries Array msaccess reports Accesstips WithEvents msaccess tips Downloads Menus and Toolbars Objects Collection Object MsaccessLinks Process Controls Art Work Property msaccess How Tos Dictionary Object Graph Charts Query VBA msaccessQuery Calculation Combo Boxes Event List Boxes Command Buttons Controls Data Emails and Alerts Form Custom Functions Custom Wizards DOS Commands Data Type Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Key Report msaccess menus msaccessprocess security advanced Access Security Add Auto-Number Field Type Form Instances Item Macros Menus RaiseEvent Recordset Top Values Variables Wrapper Classes msaccess email progressmeter Access2007 Copy Excel Export Expression Fields Join Methods Microsoft Numbering System Records Security Split SubForm Table Tables Time Difference TreeView Control Utility Workgroup database function msaccess wizards tutorial Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Common Controls Conditional Formatting Data Filtering Database Records Defining Pages Diagram Disk Dynamic Lookup Error Handler External Filter Formatting Groups Hexadecimal Numbers ImageList Control Import Labels List ListView Control Logo Macro Mail Merge Main Form Memo Monitoring Nodes Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code