Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VBA Access 2000 - Status of macro run

Posted on 2011-03-23
4
Medium Priority
?
482 Views
Last Modified: 2012-05-11
Dear Experts,

Could you please have a short look on the attached picture, I am not sure what is the name exactly of that status bar, but when a query runs in Access that used to be in the bottom left corner until it finish the run.

Is it possible to activate similiar at a code run?

Basically I have buttons which starts macros with the pressing, but I have no information in the meantime whether it finished already or not. This is why would target such status check

thanks,
Running-query.jpg
0
Comment
Question by:csehz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 58
ID: 35197622
You can display the progress meter with some code by using the SYSCMD() function.  The function call looks like this:

ReturnValue = SysCmd(action[, text][, value])

and here are the constants you can use:

acSysCmdInitMeter      Initializes the progress meter. You must specify the text and value arguments when you use this action.
acSysCmdUpdateMeter      Updates the progress meter with the specified value. You must specify the text argument when you use this action.
acSysCmdRemoveMeter      Removes the progress meter.
acSysCmdSetStatus      Sets the status bar text to the text argument.
acSysCmdClearStatus      Resets the status bar text.

  Do you need more?

JimD.
0
 
LVL 1

Author Comment

by:csehz
ID: 35197839
Jim thanks, sorry I am not too familiar with this yet and hard to imagine in working, could you have a short look on the attached code, how it could be tested in a short example?

I have just imagined a short loop and until its run, the "Progress message" shouild be in the left bottom corner.
Public Sub Test()

    SysCmd acSysCmdInitMeter, "Progress message", 100
    SysCmd acSysCmdUpdateMeter, 100


For i = 1 To 100
i = i + 1
Next i

    SysCmd acSysCmdClearStatus

End Sub

Open in new window

0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 35198038
Here's a better test:

Public Sub Test()

    Dim intI As Integer

    SysCmd acSysCmdInitMeter, "Progress message", 10000

    For intI = 1 To 10000
        SysCmd acSysCmdUpdateMeter, intI
        DoEvents
    Next intI

    SysCmd acSysCmdClearStatus

End Sub


  So you can see what it's doing.  This type of progress meter works well when you know up front how much you have to process.

  However for something  like running macros, the best you can do is to say "Running macro x of y", or in other words, your on step x of y of a process.

  So developers will often use a continuious bar just to indicate something is occuring or a timed one.  

  To help you see the differences, I'm attaching a sample DB with various progress bars.

 Holler with any questions.
JimD.
ProgressBar.zip
0
 
LVL 1

Author Closing Comment

by:csehz
ID: 35198151
Jim thanks very much, both the small example and also the database with demos, you are very helpful I learned a lot of today
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

610 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