ACC: How to Use the Status Bar Progress MeterLast reviewed: August 29, 1997Article ID: Q103404 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. You can use the SysCmd() function in Microsoft Access to create a progress meter in the status bar that gives a visual representation of the progress of an operation. When you perform an operation with a known duration or number of steps, you can use the SysCmd() function to visually represent the operation's progress. The following information documents the use of the SysCmd() function in Microsoft Access to display a progress meter. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual. NOTE: Visual Basic for Applications is called Access Basic in Microsoft Access versions 1.x and 2.0. For more information about Access Basic, please refer to the "Introduction to Programming" manual in Microsoft Access version 1.x or the "Building Applications" manual in Microsoft Access version 2.0.
MORE INFORMATIONThe syntax of the SysCmd() function is
SysCmd(<action> [, <text>][, <value>])where
- <action> is a numeric expression identifying the type of action to take. The expression is one of the following: 1 - Initialize the progress meter. 2 - Update the progress meter with the specified value. 3 - Remove the progress meter. - <text> is a string expression identifying the text that will appear left-aligned in the status bar to the left of the progress meter. - <value> is a numeric expression that controls the display of the meter. This is required when the action is 1 or 2. When the action is 1, the value indicates the maximum number the meter should display, with the maximum value for the meter indicating 100 percent. When the action is 2, the value is used to calculate and update the percentage complete in the progress meter.NOTE: The SysCmd() function returns NULL, which is not used.
Initializing the Progress MeterWhen the <action> argument is 1, the <value> argument is the maximum value of the meter, or 100 percent. To display a progress meter with a maximum value of 1000 initialized, type the following line in the Debug window (or Immediate window in versions 1.x and 2.0):
? SysCmd(1, "This is my meter!", 1000) Updating the Progress MeterWhen the <action> argument is 2, the <value> argument is used by SysCmd() to calculate the percentage displayed by the meter. To update the progress meter to 25 percent complete, type the following line in the Debug window (or Immediate window in versions 1.x and 2.0):
? SysCmd(2, 250) Removing the Progress MeterWhen the <action> argument is 3, the progress meter is removed from the status bar. To remove the meter, type the following line in the Debug window (or Immediate window in versions 1.x and 2.0):
? SysCmd(3) Using SysCmd() in a Visual Basic FunctionThe following sample function opens the Customers table in the sample database Northwind.mdb (or NWIND.MDB in versions 1.x or 2.0). The function displays a list of the contact names in the table. As the names display, a meter progresses in the status bar indicating the relative progress of the function.
? Meter() REFERENCESFor more information about the SysCmd() function, search the Help Index for "SysCmd."
|
Additional query words: thermometer statusbar
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |