Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Unanswered: Pause application for a short period of time

    Is there something like a sleep or wait-command to pause the application for a given period of time ?

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Yes.

    Try:

    Private Declare Sub sleep Lib "Kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

    OR you can write a custom delay routine ... Example:

    Code:
    Public Function LoadingDelay(Optional ByVal DisplayDelayForm As Boolean = False)
        Dim StartTime As Date
        
        DoCmd.Hourglass True
        If DisplayDelayForm Then DoCmd.OpenForm "Loading"
        StartTime = Now
        Do While True
            DoEvents
            If DateDiff("s", StartTime, Now) > 5 Then Exit Do
        Loop
        If DisplayDelayForm Then DoCmd.Close acForm, "Loading"
        DoCmd.Hourglass False
    End Function

  3. #3
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Thumbs up

    Private Declare Sub sleep Lib "Kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

    ==> you know what : This is exactly what I was looking for !!

    Thanks

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Glad to help you out ...

Posting Permissions

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