MS Access Report progress bar

Posted on 2007-07-25
Last Modified: 2008-01-09
Is it possible to have a progress bar for a report?

The report takes about 20 seconds to run, I was wondering if there is a way to have a popup to display working, then close until the report populates.
Question by:jumpy262000
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    You could use the SysCmd Method  ... InitMeter  / Remove Meter  functions ... and display info in the Status bar at the bottom of the App window.


    LVL 75

    Assisted Solution

    by:DatabaseMX (Joe Anderson - Access MVP)

    SysCmd Method
    See AlsoApplies ToExampleSpecificsYou can use the SysCmd method to, display a progress meter or optional specified text in the status bar, return information about Microsoft Access and its associated files, or return the state of a specified database object (database objects: An Access database contains objects such as tables, queries, forms, reports, pages, macros, and modules. An Access project contains objects such as forms, reports, pages, macros, and modules.) (to indicate whether the object is open, is a new object, or has been changed but not saved). Variant.

    expression.SysCmd(Action, Argument2, Argument3)
    expression    Required. An expression that returns one of the objects in the Applies To list.

    Action   Required AcSysCmdAction. One of the following intrinsic constants (intrinsic constant: A constant that is supplied by Access, VBA, ADO, or DAO. These constants are available in the Object Browser by clicking <globals> in each of these libraries.) identifying the type of action to take. The following set of constants applies to a progress meter. The SysCmd method returns a Null if these actions are successful. Otherwise, Microsoft Access generates a run-time error (run-time error: An error that can be detected only when an application is running.).

    AcSysCmdAction can be one of these AcSysCmdAction constants.
    acSysCmdAccessDir. Returns the name of the directory where Msaccess.exe is located.
    acSysCmdAccessVer. Returns the version number of Microsoft Access.
    acSysCmdClearStatus. The following constant provides information on the state of a database object.
    acSysCmdGetObjectState. Returns the state of the specified database object. You must specify argument1 and argument2 when you use this action value.
    acSysCmdGetWorkgroupFile. Returns the path to the workgroup file (System.mdw).
    acSysCmdIniFile. Returns the name of the .ini file associated with Microsoft Access.
    acSysCmdInitMeter. Initializes the progress meter. You must specify the argument1 and argument2 arguments when you use this action.
    acSysCmdProfile. Returns the /profile setting specified by the user when starting Microsoft Access from the command line.
    acSysCmdRemoveMeter. Removes the progress meter.
    acSysCmdRuntime. Returns True (1) if a run-time version of Microsoft Access is running.
    acSysCmdSetStatus. Sets the status bar text to the text argument.
    acSysCmdUpdateMeter. Updates the progress meter with the specified value. You must specify the text argument when you use this action.
    LVL 75

    Accepted Solution

    It's a little tricky to tell just when the report is populated.

    You *might* ... be able to set the report record source in the Report OnOpen event ... prior to which setting the SysCmd meter ...  then, after setting the recordsource, reset the meter ...

    Private Sub Report_Open(Cancel As Integer)
        Call SysCmd (<init meter here>)
        Me.Recordsource = "SomeQueryOrTable"
        Call SysCmd (<reset the meter here>)
    End Sub

    I'm using generic syntax for the SysCmd ...


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now