Force a form to Paint?

Ola,
My forms won't paint entirely during timer function "pauses". My DBDataform might not be able to be populated til the DB becomes available, so I made a little Please_Wait form. I copied a little Timer function pause from a previous question, .show the Please_Wait while I loop til the DB becomes available (or it times out), but the label in the Please_Wait never shows cause the paint never completes.
Here's the code:
If rsTransaction.Fields("IsBusy") = True Then
  PauseTime = 1 ' Set duration.
  Start = Timer ' Set start time.
  PleaseWait.Label1.Caption = "Waiting for Database to become available"
  PleaseWait.Caption = "Database in use Please Wait"
  PleaseWait.Show
  Finish = Timer + 5 ' Set debug end time.
 Do
  Do While Timer < Start + PauseTime
  Loop
  'debug--Pretend DB is busy 5 secs
  If Finish < Timer Then
   rsTransaction.Edit
   rsTransaction.Fields("IsBusy") = False
   rsTransaction.Update
  End If
 Loop Until (rsTransaction.Fields("IsBusy") = False)
 Unload PleaseWait

Is there a "Paint-the-dang-form-before-anything-else" function?
THanks
Bob

BobMinerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
Add a DoEvents here:

PleaseWait.Caption = "Database in use Please Wait"
PleaseWait.Show
DoEvents
Finish = Timer + 5 ' Set debug end time.
0
mcriderCommented:
Instead of doing a DoEvents, which can allow other events to fire, do this:

With PleaseWait
     .Label1.Caption = "Waiting for Database to become available"
     .Caption="Database in use Please Wait"
     .Show
     .Label1.Refresh
     .Refresh
End With



Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BobMinerAuthor Commented:
Thanks McRider
That worked perfectly.
Bob
0
BobMinerAuthor Commented:
Thanks McRider
That worked perfectly.
Bob
0
mcriderCommented:
Glad I could help! Thanks for the points!


Cheers!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.