Wait Method - Access 2003

S

Steve

In excel, we can use application.wait(secs) to get code to pause for a set
period of time before continuing. I've used this in the past to create really
simple clocks & countdowns in the past. - Is there nothing similar available
in Access 2003? I can't find anything & wouldn't know where to begin looking.

I've read a number of similar topics on here and am not sure they help. The
only reason I want to get the code to pause is that when I run it in a form,
as the code progresses and runs a bunch of queries, it draws a hangman on
screen (makes pictures visible one by one) and when the hangman's finished =
job done.

My code currently makes a line visible, then uses me.repaint to repaint the
screen - which is doesn't... and the hangman's produced in lumps on screen.
If I could get the code to wait I expect that I'd get the desired effect.

Probably a very daft question & certainly a silly reason but it'd be fun if
it worked!
 
D

Dorian

Drawing a hangman would be a non-standard method of user interface and
definitely not recommended. Windows has a status bar for this purpose which
is fully supported by MS Access.
Look up SysCmd method in Access help.

SysCmd Method
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 you specify the acSysCmdGetObjectState value for the Action
parameter, then you must specify the appropriate acObjectType.


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 you specify the acSysCmdGetObjectState value for the Action
parameter, then you must specify the name of the database object.


-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
S

Steve

Cheers Dorian, I'm aware / have used the status bar and progress bars in the
past. I just wanted to do something a bit more fun!

I have now got this working as I wanted, I do a 'me.repaint' on the form
after I make each line of the drawing visible on the form then run an
ineffectual loop in the code that'll take a few moments to complete - giving
the form time to be repainted onscreen before the next action query
commences.

This works fine for my purposes, but I would've used something on the lines
of the wait method if I was working in Excel.

Thanks for your trouble anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top