Very High processor usage for this code.

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

Guest

A botton is pressed which brings up a seperate form to allow the user to
enter some text. The "calling" code waits until a button on the "seperate
form" is pressed before continuing. Whilst waiting it chews up huge processor
usage. Any suggestions.

************* calling code
' Wait for Send or Cancel button
Do
DoEvents
Call DelaySeconds(0.5)
Loop Until Forms!EmailBody.blnSend Or Forms!EmailBody.blnCancel

*************
Public Sub DelaySeconds(Seconds)

Dim StartDelay
Dim EndDelay

Seconds = Seconds * 1000

StartDelay = GetTickCount()

Do
DoEvents
EndDelay = GetTickCount()
Loop Until EndDelay - StartDelay > Seconds

End Sub
 

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

Back
Top