Status form

  • Thread starter Thread starter Wavequation
  • Start date Start date
W

Wavequation

I have code that runs through a lot of records, and so takes some amount of
time. How can I display a status form which opens when the code starts, and
closes once the routine is finished, to inform the user that the code is
running?
 
Docmd.OpenForm "formname" (Don't use acDialog... none of the code will run if
you do)

and

Docmd.Close acForm, "formname"

Put those at the beginning and end of your procedure.

There's other ways also.

SysCmd acSysCmdSetStatus "Processing Data..."

This will put the message in the status bar at the bottom of the screen.
Just be sure to turn it off at any procedure exit

SysCmd acSysCmdClearStatus


Somewhere there's a very good tutorial on setting up a progress bar, but I
don't have access to the shortcut at the moment.
 
I've actually tried that before. Unfortunately, the form doesn't open
completely for some reason, and remains in an unopen state while the code is
running. Is there anyway I can force the form to open before the rest of the
code runs?
 
Try DoEvents maybe?

Docmd.OpenForm "frmName"
DoEvents

....
....
....


I'm not really sure.. my initial thought is that the rest of the code is
running while the form is trying to load, which I would guess might give you
that issue. DoEvents should process any pending system events before
proceeding. If that doesn't work I'm afraid you might need someone more
exerienced than I to help... I can't think of any other reason why a form
would 'resist' opening under somewhat normal situations.
 
I don't know exactly what your code does but I use the Status Bar
(Dymondjack's second suggestion) to good effect in one of my apps that
has to run through several hundred external files.

RD
 
Back
Top