Solved

Wait Procedure ?

Posted on 1998-01-11
4
161 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses
Course of the Month5 days, 19 hours left to enroll

626 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