Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 10-12-2005, 11:11 AM   #1
jaydwest
JayW
 
Join Date: Apr 2003
Location: Boulder, CO
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
jaydwest
Using Syscmd(... Update Meter)

I use syscmd(acsyscmdInitMeter) and syscmd(acSysCmdUpdateMeter) frequently. I noticed that the acSysCmdUpdateMeter has two arguments. I know the first one updates the counter, but I have not found any documentation for the second. Does anyone know how it can be used?

I would like to modify the Status Bar description that is set in the InitMeter action with the UpdateMeter action. Is there any way to do this? For example:

syscmd(acSysCmdUpateMeter, "Part 1", n)

syscmd(acSysCmdUpateMeter, "Part 2", n)

Thanks for your help

__________________
DeepPowdah
jaydwest is offline   Reply With Quote
Old 10-12-2005, 01:29 PM   #2
RuralGuy
AWF VIP
 
RuralGuy's Avatar
 
Join Date: Jul 2005
Location: @ 8300' in the Colorado Rockies
Posts: 13,821
Thanks: 7
Thanked 311 Times in 301 Posts
RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice
I looked up SysCmd in VBA help and opened up the AcSysCmdAction and there is a pretty complete description of everything you have questions about. I have ac2002.
__________________
(RG for short) aka Allan Bunch Previous MS Access MVP acXP, ac07, ac10, ac13 - WinXP Pro, Win7 Pro, Win10 Pro
Please post back to this Forum so all may benefit.
Teaching is not filling a bucket but lighting a fire.
RuralGuy is offline   Reply With Quote
Old 10-12-2005, 03:47 PM   #3
jaydwest
JayW
 
Join Date: Apr 2003
Location: Boulder, CO
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
jaydwest
Thanks but I believe the answer is no.

Nice try anyway!

__________________
DeepPowdah
jaydwest is offline   Reply With Quote
Old 10-13-2005, 01:08 AM   #4
Oldsoftboss
AWF VIP
 
Oldsoftboss's Avatar
 
Join Date: Oct 2001
Location: in the shed
Posts: 2,504
Thanks: 0
Thanked 57 Times in 49 Posts
Oldsoftboss will become famous soon enough
From Access Help !

SysCmd Method
See Also Applies To Example Specifics
You 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 (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 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.

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.
acSysCmdClearHelpTopic
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.

Argument2 Optional Variant. A string expression identifying the text to be displayed left-aligned in the status bar. This argument is required when the action argument is acSysCmdInitMeter, acSysCmdUpdateMeter, or acSysCmdSetStatus; this argument isn't valid for other action argument values.

Note When using the acSysCmdGetObjectState argument, Excel requires the use of Argument2 with one of the following intrinsic constants.

acTable
acQuery
acForm
acReport

acMacro

acModule

acDataAccessPage

acDefault

acDiagram

acServerView

acStoreProcedure

This argument isn't valid for other action argument values.


Argument3 Optional Variant. A numeric expression that controls the display of the progress meter. This argument is required when the action argument is acSysCmdInitMeter; this argument isn't valid for other action argument values.

Note When using the acSysCmdGetObjectState argument, Excel requires the use of Argument3. A string expression that is the valid name of a database object of the type specified by Argument2. This argument isn't valid for other action argument values.

Remarks
For example, if you are building a custom wizard that creates a new form, you can use the SysCmd method to display a progress meter indicating the progress of your wizard as it constructs the form.

By calling the SysCmd method with the various progress meter actions, you can display a progress meter in the status bar for an operation that has a known duration or number of steps, and update it to indicate the progress of the operation.

To display a progress meter in the status bar, you must first call the SysCmd method with the acSysCmdInitMeter action argument, and the text and value arguments. When the action argument is acSysCmdInitMeter, the value argument is the maximum value of the meter, or 100 percent.

To update the meter to show the progress of the operation, call the SysCmd method with the acSysCmdUpdateMeter action argument and the value argument. When the action argument is acSysCmdUpdateMeter, the SysCmd method uses the value argument to calculate the percentage displayed by the meter. For example, if you set the maximum value to 200 and then update the meter with a value of 100, the progress meter will be half-filled.

You can also change the text that's displayed in the status bar by calling the SysCmd method with the acSysCmdSetStatus action argument and the text argument. For example, during a sort you might change the text to "Sorting...". When the sort is complete, you would reset the status bar by removing the text. The text argument can contain approximately 80 characters. Because the status bar text is displayed by using a proportional font, the actual number of characters you can display is determined by the total width of all the characters specified by the text argument.

As you increase the width of the status bar text, you decrease the length of the meter. If the text is longer than the status bar and the action argument is acSysCmdInitMeter, the SysCmd method ignores the text and doesn't display anything in the status bar. If the text is longer than the status bar and the action argument is acSysCmdSetStatus, the SysCmd method truncates the text to fit the status bar.

You can't set the status bar text to a zero-length string (" "). If you want to remove the existing text from the status bar, set the text argument to a single space. The following examples illustrate ways to remove the text from the status bar:

varReturn = SysCmd(acSysCmdInitMeter, " ", 100)
varReturn = SysCmd(acSysCmdSetStatus, " ")
If the progress meter is already displayed when you set the text by calling the SysCmd method with the acSysCmdSetStatus action argument, the SysCmd method automatically removes the meter.

Call the SysCmd method with other actions to determine system information about Microsoft Access, including which version number of Microsoft Access is running, whether it is a run-time version, the location of the Microsoft Access executable file, the setting for the /profile argument specified in the command line, and the name of an .ini file associated with Microsoft Access.

Note Both general and customized settings for Microsoft Access are now stored in the Windows Registry, so you probably won't need an .ini file with your Microsoft Access application. The acSysCmdIniFile action argument exists for compatibility with earlier versions of Microsoft Access.

Call the SysCmd method with the acSysCmdGetObjectState action argument and the objecttype and objectname arguments to return the state of a specified database object. An object can be in one of four possible states: not open or nonexistent, open, new, or changed but not saved.

For example, if you are designing a wizard that inserts a new field in a table, you need to determine whether the structure of the table has been changed but not yet saved, so that you can save it before modifying its structure. You can check the value returned by the SysCmd method to determine the state of the table.

The SysCmd method with the acSysCmdGetObjectState action argument can return any combination of the following constants.

Constant State of database object Value
acObjStateOpen Open 1
acObjStateDirty Changed but not saved 2
acObjStateNew New 4

Note If the object referred to by the objectname argument is either not open or doesn't exist, the SysCmd method returns a value of zero.
__________________
Apathy is on the increase, but who cares.

Imagine if there were no hypothetical questions

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Oldsoftboss is offline   Reply With Quote
Old 08-02-2007, 06:42 PM   #5
Daveyk01
Newly Registered User
 
Join Date: Jul 2007
Location: Lewistown, PA
Posts: 144
Thanks: 2
Thanked 0 Times in 0 Posts
Daveyk01 is on a distinguished road
Quote:
Originally Posted by RuralGuy View Post
I looked up SysCmd in VBA help and opened up the AcSysCmdAction and there is a pretty complete description of everything you have questions about. I have ac2002.
I guess it isn't available in Acces2000
Daveyk01 is offline   Reply With Quote
Old 08-02-2007, 07:10 PM   #6
unclejoe
Registered User
 
Join Date: Dec 2004
Location: singapore
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
unclejoe is on a distinguished road
Not true, i'm using A2K and here's from Help.

Quote:
SysCmd Method

You can use the SysCmd method to perform one of the following functions:

Display a progress meter or optional specified text in the status bar.


Return information about Microsoft Access and its associated files.


Return the state of a specified database object to indicate whether the object is open, is a new object, or has been changed but not saved.

For example, if you are building a custom wizard that creates a new form, you can use the SysCmd method to display a progress meter indicating the progress of your wizard as it constructs the form.

Syntax

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

ObjectState = SysCmd(action[, objecttype][, objectname])

The SysCmd method has the following arguments.

Argument Description
action One of the following intrinsic constants 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.
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.
The following set of constants provides information about Microsoft Access.
acSysCmdRuntime Returns True (1) if a run-time version of Microsoft Access is running.
acSysCmdAccessVer Returns the version number of Microsoft Access.
acSysCmdIniFile Returns the name of the .ini file associated with Microsoft Access.
acSysCmdAccessDir Returns the name of the directory where Msaccess.exe is located.
acSysCmdProfile Returns the /profile setting specified by the user when starting Microsoft Access from the command line.
acSysCmdGetWorkgroupFile Returns the path to the workgroup file (System.mdw).
acSysCmdClearHelpTopic
The following constant provides information on the state of a database object.
acSysCmdGetObjectState Returns the state of the specified database object. You must specify the objecttype and objectname parts when you use this action value.
text A string expression identifying the text to be displayed left-aligned in the status bar. This argument is required when the action argument is acSysCmdInitMeter, acSysCmdUpdateMeter, or acSysCmdSetStatus; this argument isn't valid for other action argument values.
value A numeric expression that controls the display of the progress meter. This argument is required when the action argument is acSysCmdInitMeter; this argument isn't valid for other action argument values.
objecttype One of the following intrinsic constants:
acTable
acQuery
acForm
acReport
acMacro
acModule
acDataAccessPage
acDefault
acDiagram
acServerView
acStoreProcedure
This argument is required when the action argument is acSysCmdGetObjectState; this argument isn't valid for other action argument values.
objectname A string expression that is the valid name of a database object of the type specified by the objecttype argument. This argument is required when the action argument is acSysCmdGetObjectState; this argument isn't valid for other action argument values.


Remarks

By calling the SysCmd method with the various progress meter actions, you can display a progress meter in the status bar for an operation that has a known duration or number of steps, and update it to indicate the progress of the operation.

To display a progress meter in the status bar, you must first call the SysCmd method with the acSysCmdInitMeter action argument, and the text and value arguments. When the action argument is acSysCmdInitMeter, the value argument is the maximum value of the meter, or 100 percent.

To update the meter to show the progress of the operation, call the SysCmd method with the acSysCmdUpdateMeter action argument and the value argument. When the action argument is acSysCmdUpdateMeter, the SysCmd method uses the value argument to calculate the percentage displayed by the meter. For example, if you set the maximum value to 200 and then update the meter with a value of 100, the progress meter will be half-filled.

You can also change the text that's displayed in the status bar by calling the SysCmd method with the acSysCmdSetStatus action argument and the text argument. For example, during a sort you might change the text to "Sorting...". When the sort is complete, you would reset the status bar by removing the text. The text argument can contain approximately 80 characters. Because the status bar text is displayed by using a proportional font, the actual number of characters you can display is determined by the total width of all the characters specified by the text argument.

As you increase the width of the status bar text, you decrease the length of the meter. If the text is longer than the status bar and the action argument is acSysCmdInitMeter, the SysCmd method ignores the text and doesn't display anything in the status bar. If the text is longer than the status bar and the action argument is acSysCmdSetStatus, the SysCmd method truncates the text to fit the status bar.

You can't set the status bar text to a zero-length string (" "). If you want to remove the existing text from the status bar, set the text argument to a single space. The following examples illustrate ways to remove the text from the status bar:

varReturn = SysCmd(acSysCmdInitMeter, " ", 100)
varReturn = SysCmd(acSysCmdSetStatus, " ")If the progress meter is already displayed when you set the text by calling the SysCmd method with the acSysCmdSetStatus action argument, the SysCmd method automatically removes the meter.

Call the SysCmd method with other actions to determine system information about Microsoft Access, including which version number of Microsoft Access is running, whether it is a run-time version, the location of the Microsoft Access executable file, the setting for the /profile argument specified in the command line, and the name of an .ini file associated with Microsoft Access.

Note Both general and customized settings for Microsoft Access are now stored in the Windows Registry, so you probably won't need an .ini file with your Microsoft Access application. The acSysCmdIniFile action argument exists for compatibility with earlier versions of Microsoft Access.

Call the SysCmd method with the acSysCmdGetObjectState action argument and the objecttype and objectname arguments to return the state of a specified database object. An object can be in one of four possible states: not open or nonexistent, open, new, or changed but not saved.

For example, if you are designing a wizard that inserts a new field in a table, you need to determine whether the structure of the table has been changed but not yet saved, so that you can save it before modifying its structure. You can check the value returned by the SysCmd method to determine the state of the table.

The SysCmd method with the acSysCmdGetObjectState action argument can return any combination of the following constants.

Constant State of database object Value
acObjStateOpen Open 1
acObjStateDirty Changed but not saved 2
acObjStateNew New 4


Note If the object referred to by the objectname argument is either not open or doesn't exist, the SysCmd method returns a value of zero.
Quote:
Originally Posted by Daveyk01 View Post
I guess it isn't available in Acces2000
unclejoe is offline   Reply With Quote
Old 08-03-2007, 05:48 AM   #7
Daveyk01
Newly Registered User
 
Join Date: Jul 2007
Location: Lewistown, PA
Posts: 144
Thanks: 2
Thanked 0 Times in 0 Posts
Daveyk01 is on a distinguished road
Well, it would not even auto-complete the syscmdInitMeter....

So I gave up and added another routine that required me to add a reference, I think it was "Microrsoft Scripting Runtime" (not at program right now). Later last night (or should I say this morning), I revisited trying the progress meter again. This time it worked.

So I don't know if I was having a major brain fart, couldn't type, couldn't spell/type all those weird reference names, if that reference was needed, or what. It works now.

I started looking for it because I saw it in an access programming reference manual and thought "I've been wanting to do that!". Well the manual is for access 2002, but I though close enough. When I couldn't get Access to reconize the meter init sys command that's when I thought maybe it was an access 2002+ feature.

By bad, my brain fart or something. I hate it when something fixes itself and I have no idea why. It just fills me with confidence.

Daveyk01 is offline   Reply With Quote
Old 08-03-2007, 05:53 AM   #8
Daveyk01
Newly Registered User
 
Join Date: Jul 2007
Location: Lewistown, PA
Posts: 144
Thanks: 2
Thanked 0 Times in 0 Posts
Daveyk01 is on a distinguished road
By the way... one more thing... I wish my help were as good as yours. When I did find the command in help (wasn't there at first), it only shows it in a list an no explanantion of how to use it, the way your help file appears to.

It there a more advanced help that I can install? I am wondering if our corporate addiional of Access2000 has stripped down help? It has been failry good on a lot of other topics, but now those are all basic to me.

I have had instances where it poped up and states some help file wasn't installed but then it always crapped out trying to install it. I don't rememeber the specificas about that.
Daveyk01 is offline   Reply With Quote
Old 08-05-2007, 05:19 PM   #9
unclejoe
Registered User
 
Join Date: Dec 2004
Location: singapore
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
unclejoe is on a distinguished road
Hi Dave,

Try to update the Access service pack to version 3. Else, i don't know.

What i know about this, is that A2K has problems with the Help file. How to solve it? I really don't know.

If Help crash out on you, press ctrl-Alt-Del keys to bring up the task manager.
Go to the "Process" tab. There might be one or two Help file running at this time. if there are, just select and click "End Process" button. (both if got two) and open Help again. (file is something like "MSOHELP.EXE" i think)

Quote:
Originally Posted by Daveyk01 View Post
By the way... one more thing... I wish my help were as good as yours. When I did find the command in help (wasn't there at first), it only shows it in a list an no explanantion of how to use it, the way your help file appears to.

It there a more advanced help that I can install? I am wondering if our corporate addiional of Access2000 has stripped down help? It has been failry good on a lot of other topics, but now those are all basic to me.

I have had instances where it poped up and states some help file wasn't installed but then it always crapped out trying to install it. I don't rememeber the specificas about that.
unclejoe is offline   Reply With Quote
Old 08-05-2007, 11:54 PM   #10
unclejoe
Registered User
 
Join Date: Dec 2004
Location: singapore
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
unclejoe is on a distinguished road
Hi Dave,

If you're still around, try MS site Here the Help file error
unclejoe is offline   Reply With Quote
Old 08-06-2007, 04:53 AM   #11
Daveyk01
Newly Registered User
 
Join Date: Jul 2007
Location: Lewistown, PA
Posts: 144
Thanks: 2
Thanked 0 Times in 0 Posts
Daveyk01 is on a distinguished road
Talking

Quote:
Originally Posted by unclejoe View Post
Hi Dave,

If you're still around, try MS site Here the Help file error
Well that took me about half an hour of reading the micorsoft site, copying the chm files. editing the registry but it now works.

I did have SP-3 instlled, but nor SR-1a. I thought Service Release verses Service Pack, maybe two different things so I tried following the microsoft links to install SR-1A and it was reported that I already had it installed.

So that is when I manually copied everything and edited the registry. None of those files had been installed and the ADO help location in the registry was incorrect.

Now thos help topics work. Thanks very very much for this link!

Dave
Daveyk01 is offline   Reply With Quote
Old 08-06-2007, 04:49 PM   #12
unclejoe
Registered User
 
Join Date: Dec 2004
Location: singapore
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
unclejoe is on a distinguished road
Hi Dave,

Great! Good to hear that it works for you.

unclejoe is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Review - Table Design - Meter Reading / Adjustments Cosmos75 Tables 1 08-04-2005 11:06 AM
How to display a message while generating report.. vsap Forms 1 06-07-2005 07:25 PM
Update Query problem Blackwidow Queries 1 03-18-2004 03:00 AM
How can I force before update event proc araskas Forms 1 08-23-2001 08:06 PM




All times are GMT -8. The time now is 12:02 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World