[AccessD] Determine current page number of report in preview

A.D.Tejpal adtp at touchtelindia.net
Mon Sep 6 08:52:17 CDT 2004


Gustav,

    It is observed that events generated by a report opened in preview mode, get exhausted in the first forward pass through its pages. 

    As a result, in case of any subsequent navigation through the pages already covered, there is no more firing of any event at all. Values pertaining to Page and CurrentRecord properties of the report remain stuck at the highest value touched (even if the page now being viewed is a lower one in the sequence).

    In view of the above, any attempt to obtain the current page number (in subsequent passes) from code within the report's module, gets vitiated on account of non-availability of any event that could activate such code.

    If your situation permits use of code attached to a form, a solution could be worked out, adopting either of the following approaches -
    (a) Combination of SendKeys method along with API calls. It is based upon the feature that pressing F5 key in the report preview window selects the contents of page counter window at bottom left.
    (b) Avoiding use of SendKeys by using additional API calls.

    (In case of (a), the code involved is relatively simple, while (b) might need very bulky & tedious code)

    I can send you a sample db demonstrating a solution of type (a) above. Your eMail address to be used for this purpose, may please be advised.

    If you are keen to evolve a solution of type (b) above, you could get some working ideas from the function  fTurnPage()  at Stephan Leban's site.

Regards,
A.D.Tejpal
--------------

  ----- Original Message ----- 
  From: Gustav Brock 
  To: Access Developers discussion and problem solving 
  Sent: Thursday, September 02, 2004 13:40
  Subject: [AccessD] Determine current page number of report in preview


  Hi all (Drew?)

  How do you catch the current page in preview?

  Access caches pages while you are browsing forward.
  Fine, but if the user moves (browses) backwards, the Page property stays on the highest number even though the preview displays the correct lower page number.

  I guess the only chance would be to catch the current page number from the status line of the preview window but I don't know if that is possible.

  /gustav




More information about the AccessD mailing list