Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002

    Post Unanswered: Is there a way to pause code ?

    I am starting another application using the shell command and then other needs to begin after the new application has started. But as you know the code continues, even if shell is not done.
    I have already put a msg box in that waits for me to click OK to continue, but I want a cleaner way to do this.

    Any suggestions?

  2. #2
    Join Date
    May 2002
    Atlanta, GA

    There is a way to make VB Code pause. You can use the Sleep method by declaring the Sleep Lib "Kernel32".

    Try this

    Option Compare Database
    Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMS As Long)

    Private Sub Command0_Click()
    Sleep 1000
    MsgBox "There should have been a one second pause."
    End Sub

    When the button is clicked there should be a one second pause then the msgbox will appear.

    Thats All!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts