Pause VB Execution for seconds? 
Author Message
 Pause VB Execution for seconds?

I would like to pause execution of VB Code for a couple
different reasons, but one is so I can "DoCmd.Beep"
multiple times in a row for a scanner input error.  The
processor now is so fast that the beeps are processed at
the same time.  I am looking for something like:
          Pause(1000)  where 1000 is milliseconds.

Any ideas?



Mon, 27 Jun 2005 05:03:28 GMT  
 Pause VB Execution for seconds?


Quote:
>   I am looking for something like:
>           Pause(1000)  where 1000 is milliseconds.

The function is Sleep()

If it's not in Access (I've just looked, it's not) I know it's in the
Scripting library, and it's also dead easy to use direct from the API.

Check http://www.mvps.org/access/

Tim F



Mon, 27 Jun 2005 07:41:45 GMT  
 Pause VB Execution for seconds?
You can use this procedure, calling

    Pause 1000

Sub Pause(miliseconds As Long)
Dim Wait As Double

    Wait = timer + (miliseconds / 1000)

    Do While timer < Wait
        DoEvents
    Loop

End Sub

--
Saludos desde Barcelona
Juan M. Afan de Ribera
MVP [Ms Access]



Quote:
> I would like to pause execution of VB Code for a couple
> different reasons, but one is so I can "DoCmd.Beep"
> multiple times in a row for a scanner input error.  The
> processor now is so fast that the beeps are processed at
> the same time.  I am looking for something like:
>           Pause(1000)  where 1000 is milliseconds.

> Any ideas?



Mon, 27 Jun 2005 07:53:40 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Wait - ie pause execution x number of seconds.

2. Pausing execution of a VB app

3. I'd like my VB app to pause for 5 seconds

4. Pausing Code Execution

5. Pause execution of VBA Code and Restarting!

6. Pausing code execution while another form open

7. Pause code execution while form is open

8. ***Getting Access 2.0 to pause in the execution of a module

9. Pausing Code Execution - How?

10. Pausing program execution

11. Pause event execution

12. Making a pause in the execution of a form

 

 
Powered by phpBB® Forum Software