Results 1 to 3 of 3
  1. #1
    DevGreg is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2009
    Posts
    1

    Pause / Wait / Countdown / Timer


    Hello guys,

    My question is simple : when selection a specific item, I'd like to change the backcolor of an object during one second, then restore the original backcolor.

    What is the command to pause things like that?

    In Excel 2002 VBA, I used the command
    Code:
    Application.Wait (Now + TimeValue("0:00:02"))
    But it doesn't seem to work with Access or at least with Access 2007.

    In the help, I saw
    Code:
    Dim PauseTime, Start, Finish, TotalTime
    If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes Then
        PauseTime = 5    ' Set duration.
        Start = Timer    ' Set start time.
        Do While Timer < Start + PauseTime
            DoEvents    ' Yield to other processes.
        Loop
        Finish = Timer    ' Set end time.
        TotalTime = Finish - Start    ' Calculate total time.
        MsgBox "Paused for " & TotalTime & " seconds"
    Else
        End
    End If
    But it seems quite complicated for what I want to do (I don't like the do while / do events).

    Thank you in advance. :-)

  2. #2
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    644

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,819
    Thirteen year old thread?
    Think the might have a solution, else would have been back?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pause state?
    By Zermoth in forum Programming
    Replies: 1
    Last Post: 12-15-2008, 05:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums