Is there a way to create a delay (1 Viewer)

woknick

Registered User.
Local time
Today, 07:18
Joined
Sep 25, 2004
Messages
85
Im wondering if there is a way to create a delay. If I had multiply images and I wanted to display them for a certain amount of time on a form, how would I go about doing this.

thanks in advance
 

dcx693

Registered User.
Local time
Today, 10:18
Joined
Apr 30, 2003
Messages
3,265
Look up the Timer function. I've never really used it myself, though.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:18
Joined
Feb 28, 2001
Messages
27,398
Overview:

A form has a property called ".Timer" which is milliseconds.

When you set the timer to a positive integer, Access ticks it down until it goes zero. At any time, you can read the timer to see what time is left.

The Form_OnTimer event fires when the timer ticks down to zero. It never goes negative on its own.

In that event routine, you can do other actions but must also remember to RELOAD the timer property - or decide to set it to zero if you ran into an end condition.

The implication is that you would have a button to click that would open your recordset of slide pointers. It moves to the first record of the recordset. It brings up the first image display. It loads the timer.

The timer routine has the EOF test for the recordset and doesn't do a .MoveFirst, it does a .MoveNext, but the rest of the routine (i.e. loading the display) is the same as the button-click routine that started it all.

Which probably means you have grounds for making at least part of it a subroutine.

Hope that's specific enough for you.
 

ghudson

Registered User.
Local time
Today, 10:18
Joined
Jun 8, 2002
Messages
6,194
My method to display animation (.GIF files) does not involve ActiveX or DLL's. Not that you are trying to display animated GIF files but my method will show you how to display multiple images for a specific about of time. Check out my sample db link to see how easy it is to use GIF files in your forms.

Animation - using animated GIF files in your db's

You must be a member of www.UtterAccess.com to download the sample files but it is free and worth every cent.

HTH
 

ghudson

Registered User.
Local time
Today, 10:18
Joined
Jun 8, 2002
Messages
6,194
If you are only after a routine that will "pause" an action in your db then you should try the function below. It has an advantage over the Sleep API when it comes to displaying graphics and slowing down certain events.

Code:
Public Function Pause(NumberOfSeconds As Variant)
On Error GoTo Err_Pause
    
    Dim PauseTime As Variant, Start As Variant
    
    PauseTime = NumberOfSeconds
    Start = Timer
    Do While Timer < Start + PauseTime
    DoEvents
    Loop
    
Exit_Pause:
    Exit Function
    
Err_Pause:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_Pause
    
End Function
You can vary the seconds of the pause by calling it like this...

Pause (5) 'for a five second pause

HTH
 

Users who are viewing this thread

Top Bottom