Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delay by a second

Status
Not open for further replies.

foaly

Programmer
Oct 27, 2003
5
0
0
NL
How do I delay the progress with a second cause I want to use a counting clock but i cant use a one second break in my loop.
And is their a possebility to export to a exe file?
please help me
Foaly
 
Hi Foaly,

for the delay, add a timer to your form.
Add:
Timer1.Interval = 1000
By Timer1.Enabled=True / False you can easily add your delay.

The interval is always set to milliseconds.

Andy
 
Yes well that was the plan but their is no timer in my toolkit and I can't find it anywhere so.... If you know where I can find it please tell me.
 
I'm not sure what you mean by "I can't use a one second break in my loop" - possibly you mean you can't use this! But have you tried using Timer? This gives the amount of seconds which have passed since midnight. You can use this to create a pause like so:

Dim start, pause
start = timer 'set the start time
pause = 15 ' set the pause to be 15 seconds (or whatever you prefer)
do while timer < start + pause 'loop through this until the duration is complete
doevents ' allow other events to continue during the pause
loop
 
Oké thanx it works now I had forgotten to type DoEvents and it crashed all the time. Again Thanx
Foaly
 
Ehm well it works this way better because I can work while it's busy. But I just heard vba is not compatible with so i cant make it stand alone and that's a bigger problem :-(.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top