Updating Files Message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Welcome form (menu) and I would like to update and backup my files
when it opens (only every 2 weeks). I have written the code and everything
updates fine but since I only do the update twice a month, sometimes the form
opens quickly and sometimes it takes about 10 seconds. So I would like to
incdicate to the user that it is happening and it's not just the computer
bogging down. I do the update in the load event of the Welcome form and I
tried to open a form at the beginning of that with a nice flashing message
form. When I run it, the message form opens but all I see is the frame or
border of it. I also tried putting a flashing label on the welcome form
itself which would become invisible when done, but the form won't appear
until the load event is done. Can you help me with how this type of thing
is normally done.?. Any articles on it? Am I doing the update in the 'right'
place?? Thanx
 
Hi Gil,

try this:

make a form:

Name -- PleaseWait
Caption -- PleaseWait

with a label control whose caption is "Please Wait..."

in the OPEN event of your Welcome form, open PleaseWait
(it may just open with a box around it but the caption
should be readable)

docmd.openform "PleaseWait"

and once your code is done, close form PleaseWait

on error resume next
docmd.close acform, "PleaseWait"
'substitute your line label for the error handler
'for Proc_Err
on error goto Proc_Err




ERROR HANDLER CODE:

put this at the top of your program, right after the
procedure declaration (skip a line first for better readability)

'~~~~~~~~~~~~~~~~~~~~~~
On Error GoTo Proc_Err

'~~~~~~~~~~~~~~~~~~~~~~
... then your statements
'~~~~~~~~~~~~~~~~~~~~~~

put this at the end of the program

'~~~~~~~~~~~~~~~~~~~~~~
Proc_Exit:
On Error Resume Next
'release object variables if any
Exit Function

Proc_Err:
MsgBox Err.Description, , _
"ERROR " & Err.Number _
& " ProcedureName"

'press F8 to step through code and debug
'remove next line after debugged
Stop: Resume
Resume Proc_Exit

'~~~~~~~~~~~~~~~~~~~~~~


Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Thanx for the response, Crystal. I was on vacation for a week in my RV so I
had no interenet hookup. I had tried the open event and like you said only
the border appeared. I fooled around with it on vac and came up with opening
the 'message form first and using its timer event (interval only 10) to open
the Welcome form. That way the form was completely open and the 'updating
files' label was visible. When it's not going to do a big update you can
barely see the 'message form' open, and when there is a big update the form
stays open until it's done Then I close the Message form at the end of the
Load event of the Welcome form. It works very nicely but I was hoping to
have the label flashing and I can't seem to get it to do it. I've seen
applications where it opens to a 'please wait' and it's flashing, b/4 the
application gets started. I would imagine someboby has a set way to do this
which is 'accepted' by all.?. Any ideas?? Thanx again, I will be standing
by this time until Tues,the 4th. Going to see Paul Simon @ Cooperstown, NY,
in concert.
 
Hi Gil,

you can use DoEvents to make the form really appear instead
of just its ghost :)

to make the label flash, you can use a timer event to toggle
the visible property of the display control

Sounds like a great concert! I am envious! I have a Simon
& Garfunkel songbook (I play the piano) and it is one of the
few books that I can play just about every song from.

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Doevents may do it all.... have never used it myself.

I had some vba code running that did a LOT of work and I was trying to
get an idea of its progress but was having the same type of problem of
getting the info to show. For me I had to add a
forms![formname].repaint to the vba and it was able to show me exactly
where it was.

Maybe forcing a repaint of the message box after it is opened will
force the refreshing of the screen that is essentially what you need.

Ron
 
DoEvents is used to make VBA pay attention to what is
currently happening and look to see if the OS (Operating
System) has any requests.

ie: if you have a loop and want to be able to BREAK it with
CTRL-BREAK, put DoEvents into the loop

DoEvents will also update values written to a form by a
general procedure or code behind another form or report

A DoEvents is done when you use MsgBox, or are stepping
through code (since it has to pay attention to the keyboard)

It is a good way to say, "Wake Up!"

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Back
Top