How to delay (1 Viewer)

RuralGuy

AWF VIP
Local time
Yesterday, 21:08
Joined
Jul 2, 2005
Messages
13,825
So maybe this API will do the trick.
 

darbid

Registered User.
Local time
Today, 05:08
Joined
Jun 26, 2008
Messages
1,428
Just to give you another option. While watching Winrar last night (boring life) I noticed that while unzipping it created temp files which are gone when the final file was completed.

Maybe bullzip does the same thing while zipping/unzipping. You could test for the existance of these.
 

Dudley

Registered User.
Local time
Yesterday, 20:08
Joined
Apr 7, 2004
Messages
147
Hi Everybody,
Darbid, RG, and Dave (gemma-the-husky), thank you so much for your help. Darbid's link provided the EnumWindows code that let me identify BullZip's class, which I could then add to the code in RG's link for IsAppRunning.

Here's that piece:
Code:
        Case "bullzip":     strClassName = "ThunderRT6FormDC"

Then I added a loop before sending each Report to BullZip:
Code:
Do While fIsAppRunning("bullzip")
Loop

And it seems to work fine.

I can't thank you all enough for your help. :)
 

RuralGuy

AWF VIP
Local time
Yesterday, 21:08
Joined
Jul 2, 2005
Messages
13,825
Excellent. I would add a DoEvents to your loop to give Access some cpu time.
Code:
Do While fIsAppRunning("bullzip")
   DoEvents
Loop
You might also want to bail out for some reason so maybe looking for the Escape key would be useful.
 
Last edited:

Dudley

Registered User.
Local time
Yesterday, 20:08
Joined
Apr 7, 2004
Messages
147
Thank you, RG. I've seen the DoEvents thing in people's code before, but I didn't really understand what I read in the Help file. Can you refer me somewhere that explains it?

The Escape key thing is a good idea too. I'm going to start searching for a way to code that - I don't know how at the moment.

I really appreciate your help!!
 

RuralGuy

AWF VIP
Local time
Yesterday, 21:08
Joined
Jul 2, 2005
Messages
13,825
Even though Access is single threaded, it is still multi-tasked. That means that some tasks is Access can get to run more often than others depending on the priority of the task. The loop you had holds the cpu right there in the code while issuing a DoEvents returns the cpu to the tasker and would allow the keyboard input task to run for example.
 
Last edited:

vicsar

https://about.me/vicsar
Local time
Yesterday, 21:08
Joined
Jul 25, 2012
Messages
35
This is what's great about the internet - ghudson, it's more than a year later, but your little bit of code saved me a lot of time today, thanks a lot for sharing.

Regards
Meltdown

How about a few years later, hello and thanks from 2013 :)
 

Shelby1991

New member
Local time
Yesterday, 20:08
Joined
Sep 4, 2013
Messages
6
is there a way to use this code but have the number of seconds that you want to wait be set depending on your record be based off a field in a table?
 

RuralGuy

AWF VIP
Local time
Yesterday, 21:08
Joined
Jul 2, 2005
Messages
13,825
You'll need to tell us which posting you used but the answer is almost certainly yes.
 

Users who are viewing this thread

Top Bottom