Results 1 to 4 of 4
  1. #1
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150

    Post MS Access - Millisecond time interval delay & screen updating for "animation"

    Hi,

    Delaying milliseconds is a topic has been beat to death just about everywhere, especially in Excel. And despite that, i've never come across a single piece of code that is able to delay time in MS Access for less than a second.

    I've used Win APIs and a host of other functions without any success. But i'm beginning to questions if the delay is actually occurring but "screen updating" is not occurring?

    Usually when someone wants to delay time in MS Access or Excel, they are trying to execute a lousy animation (which is quite fun).

    Assume the following example, where we also assume "DelayMS" is a function for delaying milliseconds...

    Code:
    Private sub animate()
    Dim i     as integer
    
    
    For i = 1 to 100000
        textbox1.left = textbox1.left + i
         DelayMS(200)  '200 millisecond
    Next i
    
    End sub

    So my questions are...

    1.) Will the above be able to "animate" this textbox? Or is there a missing element - additional piece of code to update screen, etc.

    2.) Are millisecond delays possible, if so, do you have a proven working function you'd be willing to offer?


    Thanks for your time.

  2. #2
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150
    EDIT:

    So I am beginning to think that the delay functions i've tried are in fact working but Access will not update the screen fast enough which results in a crash!

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Code:
    Sub Pause(sngDelay As Single)
    Dim varTimer As Variant
    varTimer = Timer
    Do Until Timer = varTimer + sngDelay
    Loop
    
    End Sub
    I've used this for less than 1 second delays, but not for animation. AFAIK it worked for my purpose but never caused a crash.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150
    Thanks everyone. I will close the thread and establish a new topic if my animation endeavors become unsuccessful!

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

Similar Threads

  1. Replies: 12
    Last Post: 10-01-2018, 02:40 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 4
    Last Post: 05-28-2015, 01:51 PM
  4. Replies: 9
    Last Post: 09-16-2014, 03:56 PM
  5. Replies: 4
    Last Post: 06-24-2013, 07:12 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