Solved

Wait Procedure ?

Posted on 1998-01-11
4
160 Views
Last Modified: 2012-06-27
How can i tell the progam to wait for a few second before
proceeding to the next procedure ?


for example :

for i = 0 to 100

form1.combo1.additem (variables)

next i

****wait for 5 seconds

form2.show
0
Comment
Question by:netcool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Trygve earned 10 total points
ID: 1450414
Here a little function that might help

Function Wait(HowLong, interval)

    Dim StartedAt As Date
    StartedAt = Now
   
    Do Until DateDiff(interval, StartedAt, Now()) >= HowLong
    Loop

End Function

Interval:
yyyy      Year
q      Quarter
m      Month
y      Day of year
d      Day
w      Weekday
ww      Week
h      Hour
n      Minute
s      Second

Hope this helps !
Trygve
0
 
LVL 1

Expert Comment

by:redbaron082997
ID: 1450415
You may want to add a doevents inbetween the loop, that way other apps will run, and not stop.  Just a suggestion.
0
 
LVL 12

Expert Comment

by:Trygve
ID: 1450416
redbaron is right.

DoEvents will allow Windows to process all upcomming events.

BUT if the wanted delay is small (couple of seconds) I would suggest to leave it as it is (perhaps make the function check the length and doevents for surtain combinations of HowLong and interval). When windows start performing events it can go on for quit some time.
0
 
LVL 1

Expert Comment

by:redbaron082997
ID: 1450417
Good Point.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

729 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