Solved

Is there a Sleep type command?

Posted on 1998-11-23
4
240 Views
Last Modified: 2010-05-03
Is a Sleep type command available to make the program wait for a certain amount of time?  I don't really want to use a timer control.  Or should I just create a loop to do the waiting
0
Comment
Question by:louy
  • 2
4 Comments
 
LVL 3

Expert Comment

by:vikiing
ID: 1446309
There's no Delay nor Sleep command available to use (there are a lot of incredible things VB lacks). You can use a Time event, or a Do/Loop cycle with Timer control to "stop" program execution during a certain time:

Limit=Timer + 0.5
Do until Timer => Limit : Loop

That code cycles during half a second. Of course, the added value can be less than 0.5

0
 
LVL 2

Accepted Solution

by:
JiaH earned 50 total points
ID: 1446310
Yes. Use the sleep API as following:

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

0
 
LVL 3

Expert Comment

by:vikiing
ID: 1446311
Great !!!; I dídn't know that !!!!
0
 

Author Comment

by:louy
ID: 1446312
Thanks, sorry about the delay.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 103
MS Acccess - Update Field in Table when report is printed 6 44
Windows Script Host failed (Access is denied.) error 6 109
message box in access 4 41
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now