Results 1 to 5 of 5
  1. #1
    gopherking is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    71

    Open Multiple Reports one after another, not all at once

    I have 3 rather large reports that are being opened (what seems to be) simultaneously and they seem to take quite a while to open. I am wondering if there is a way to open them one at a time (make them visible after they have loaded) before starting the next one. I know that I could put in an event on the previous report to open the next one, but the future consideration is that these reports could be called individually or all together depending on the user's preference.

    When a user clicks a button, all the reports are called within VBA one after the other. Below are the calls in my code:



    Call OpenReport("RPT1")
    Call OpenReport("RPT2")
    Call OpenReport("RPT3")

    These go to a Module that has some Error Handling and also the "DoCmd.OpenReport rpt, acViewReport" code to open the reports.

  2. #2
    boywonder is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Dec 2010
    Location
    Memphis, TN
    Posts
    60
    Have you tried using:

    SendKeys "+", True

    This will wait until you click the shift key to continue

  3. #3
    gopherking is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    71
    That would work, however I am trying to make it as automated as possible and any additional clicks for a user and they consider it not automated. Any other suggestions?

  4. #4
    gopherking is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    71
    Sorry boywonder, it is early in the morning and I didn't quite understand your response.

    Adding in the SendKeys "+", True doesn't seem to have any impacts on the opening of the reports. They still all appear at once. Any other suggestions?

  5. #5
    gopherking is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    71

    Lightbulb

    After some investigation this morning, I found that you can build a Wait timer in your code, but also found that it doesn't improve the processing speed of the reports, and actually makes it seem like it takes longer (perceived time) as one report is opened and then the next one begins processing. I have determined that it is best to leave it as is and allow all three to process at the same time and then display all three when completed.

    However, just in case anyone is in need of the Wait Timer code, here it is ...

    Create a Module to store the following code (I called mine basTimer):

    Code:
     
    Sub Wait(PauseTime)
    Dim Start, Finish
        Start = Timer    ' Set start time.
        Do While Timer < Start + PauseTime
            DoEvents    ' Yield to other processes.
        Loop
        Finish = Timer    ' Set end time.
        
    End Sub
    Then in any of your code elsewhere you simply insert a line to call the timer as shown below:

    Code:
     
    Call Wait(5)
    Since there is no declaration of the PauseTime being Integer, Long, etc. it will accept fractions of seconds as well. During my testing, I was able to enter a .1 in the Call Wait() code and it waited for only a fraction of a second, however that still affected perceived time, which really bothered me.

    The only other warning that I need to offer based on my searches online is that the above code may be affected if run around the time of Midnight. I have seen other postings that refered to Wait Timers they had setup that were affected by the day switch at midnight that caused their code to be in a paused state for a full day. I haven't had a chance to test this (being that it is 8:10 in the morning and I'm not planning on staying up late tonight to test it), so I caution you to use at your own risk!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple Sub Reports
    By Top Fuel Friday in forum Reports
    Replies: 8
    Last Post: 02-17-2014, 11:37 AM
  2. Reports w/ sub-reports very slow to open
    By vaikz in forum Reports
    Replies: 2
    Last Post: 02-27-2011, 08:41 AM
  3. Replies: 1
    Last Post: 07-02-2010, 03:55 AM
  4. Combo box open reports
    By GUMUBIBI in forum Programming
    Replies: 5
    Last Post: 09-06-2009, 04:36 PM
  5. Multiple Reports within Report
    By jakelufkin in forum Reports
    Replies: 0
    Last Post: 08-31-2009, 08:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums