Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Progression Bar

    When I run a long query, MS Access displays a progression bar at the bottom of the screen by default.

    Is there a way to use this intrinsic functionality in a query run with all the features in the startup menu unchecked (so only the form shows unless you hit F11, if I'm making sense). Further, is there a way to create a progression bar in the form that will function with a query execution?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Query Progression Bar

    There are actually several ways to create a progress bar, although I'm not clear on whether you want to create it from form code or from somewhere else.

    One way is to use the SysCmd method to display a progress bar like the one you see. Here's a snippet of code lifted from on-line help on SysCmd:

    <pre> If lngCount Then
    strMsg = "Reading " & UCase$(strTableName) & "..."
    varReturn = SysCmd(acSysCmdInitMeter, strMsg, lngCount)
    ' Display message in status bar.
    For lngX = 1 To lngCount
    varReturn = SysCmd(acSysCmdUpdateMeter, lngX)
    ' Update meter.
    ' Do something with record.
    .
    .
    rst.MoveNext ' Go to next record.
    Next lngX
    varReturn = SysCmd(acSysCmdClearStatus)</pre>


    Another way is to use an ActiveX control built for that purpose, and I've also seen unbound forms with a series of square colored labels whose visible property is set to true sequentially based on a timer or a calculation of some sort.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Progression Bar

    Thanks for your reply, Charlotte.

    I don't think I'm doing a very good job of explaining this.

    When you run a query normally, it displays a progression bar by default. I guess Access figures out the upper limit of the query and then is able to increment the progression bar it displays with whatever process it does to run it.

    My problem is that when I deliver an application, I go into start-up and tell it to open a default form. I also uncheck all the boxes so they don't have the Access interface, only my form. When I do that, the default Access progression bar doesn't display when a query is run.

    At the least, if it is possible, I would like to display that progression bar that Access displays normally in the corner - and at most, I would like to display my own progression bar in the form when the query is run.

    I know that the SysCmd is used to display that progression bar in the application manager, but when you execute a query that is stored in Access's query collection, how do you tell it to display that and increment it?

    As a real basic example, you have a query "SELECT * FROM Customers" and you save it as "qryCustomers". You double click on qryCustomers in the queries tab, and it displays a progression bar in the corner as it queries the million or so records. When you do what I described above with the start-up settings, that no longer displays. I want to turn that back on when a query is executed. Using the SysCmd function, I don't know what to pass to lngCount (unless I calculate the recordcount separately which would seriously extend the query execution for the end user), and I don't know how to increment somthing that Access is doing on its own.

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Progression Bar

    If you want to just display the built in progress bar for your query go back into the startup options and check the box next to Display Status Bar.

Posting Permissions

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