Results 1 to 14 of 14
  1. #1
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    I have several reports that can be selected from a switchboard. The goal is to display them page by page in the maximum space possible, i.e. the screen area below the ribbon. All reports have an Open Event which contains a single line DoCmd.Maximize. All reports are opened by a DoCmd.OpenReport "rptName",acViewPreview.
    But the reports do seem to have their own will: some will display as I want it, others (most) do not. As far as I checked, all reports have the same design properties set. So what is Happening?

    In particular some reports do not maximize and do not display the page selector at the bottom. (all are multipage).

    It can be corrected by manually resizing the report (the control button between minimize and close) and the maximizing them (same button) but I find this an unnecessary burden put on the user. Can this be automated?

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    You could try putting the Maximize command against the reports ON Activate event rather than the Open Event
    Andrew

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I am not sure if this will help, but I always set the Autoresize property of Reports to No. This ensures that they open in a readable view.
    Regards
    John



  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Another possibility which we use regularly is to set your database so it displays as tabbed documents in the Access Options. Then report previews always are maximized.
    Wendell

  5. #5
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Thanks all three for your suggestions. I implemented the DoCmd.Maximize on the Activate event and set Autosize to No for all reports. The latter option had seemingly the most effect: the page selector now appears on all reports. However the report itself is no longer centered. It appears that setting Autosize to No, disables I think this feature could be useful AutoCenter? Can I do anything about that?

    Tabbed Documents do behave similarly: they display the page selector, but they are cropped up in the top left corner. This seems to be a global option and does also apply to forms, which makes it even uglier (I think this feature could be useful if your application is designed up front to take advantage of it - which is not the case here)

  6. #6
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Thanks all three for your suggestions. I implemented the DoCmd.Maximize on the Activate event and set Autosize to No for all reports. The latter option had seemingly the most effect: the page selector now appears on all reports. However the report itself is no longer centered. It appears that setting Autosize to No, disables [s]I think this feature could be useful [/s]AutoCenter? Can I do anything about that?

    Tabbed Documents do behave similarly: they display the page selector, but they are cropped up in the top left corner. This seems to be a global option and does also apply to forms, which makes it even uglier (I think this feature could be useful if your application is designed up front to take advantage of it - which is not the case here)

    Sorry for the correction

  7. #7
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    I just "discovered" that on the Print Preview Ribbon, in the section Zoom, there is a button called "One Page". Clicking that button seems to solve both the problems of centering the page and displaying the Page Selectors. Is there a way to Click that button by programming (in the Open/activate event)?

  8. #8
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    You could use the Macro Command
    Code:
    DoCmd.RunCommand acCmdPreviewOnePage
    However I have not found a way to make this run as part of the reports events
    Load, Open, Activate, Got Focus
    All Generate error.

    Also it cannot run unless a report is open in preview mode

    So It is possible if you run it as part of a report opening macro

    For Example

    Code:
    DoCmd.OpenReport "Put Your Report Here", acViewPreview
    DoCmd.RunCommand acCmdPreviewOnePage
    It might be possible to do it as part of the Activate Event using the older SendKeys Menu Action,
    but I cannot remember a sequence from Access 2003 to do this without starting up
    another machine

    It would start SendKeys "%V" though (if it is possible)

    I might look later, but the dog wants to go out.
    Andrew

  9. #9
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Andrew, Your suggested RunCommand acCmdPreviewOnePage does the job perfectly!

  10. #10
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    That's Good.

    IF You had to run it against a sendkeys action from inside a report

    This ought to work (example is on the Activate Event)

    It works in 2003 and so ought to work in 2007

    Code:
    DoCmd.Maximize
    
    SendKeys "%VaO"         'This is the Old Menu for View One Page
    Andrew

  11. #11
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Andrew, to take further advantage(!) of the ribbon one can use:

    DoCmd.OpenReport "rptToShow", acViewPreview
    Application.CommandBars.ExecuteMso ("Zoom100")


    The same restrictions seem to apply (it did not work from the activate event)

  12. #12
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Did you try setting the autocenter property of the reports to Yes?

    [attachment=87642:autocenter.gif]

    Quote from Help:
    Depending on the size and placement of the application window, reports can appear off to one side of the application window, hiding part of the form or report. Centering the report automatically when it's opened makes it easier to view and use.

    Attached Images Attached Images
    Regards
    John



  13. #13
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    John, Yes I did set AutoCenter to Yes, but as I wrote before:
    It appears that setting AutosResize to No, disables AutoCenter?
    I didn't do any further testing for other combinations of these properties, as the suggested RunCommand (or its ribbon alternative) did the job.

    Do you happen to know a place where I can find a decent explanation of a) the types of report view and b) the report properties influencing its screen appearance?

  14. #14
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    Bruges, Belgium
    Posts
    122
    Thanks
    14
    Thanked 2 Times in 2 Posts
    CORRECTION

    The correct sequence to view one page at the time, using ribbon commands is:

    DoCmd.OpenReport "rptToShow", acViewPreview
    Application.CommandBars.ExecuteMso ("ZoomOnePage")


    It is slightly annoying that you efffectively see the shift to the center of the page in the blink of an eye. But I can live with that (for the moment)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •