473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Best way to make Access 2.0 code wait 10 seconds before processing the next line???

MLH
Best way to make Access 2.0 code wait 10 seconds before processing the
next line???

For i=1 to whatever : next i
is just too processor intensive.

Isn't there something less taxing
I can use???
Nov 13 '05 #1
4 2868
Trevor Best wrote some great code to do this a while ago. Here's that
code:
Sub WaitFor(psngSeconds As Single)
' wait for specified number of seconds
' Copyright Trevor Best (tre...@besty.org.uk) <-OK, so I added
thisline.

Dim sngStart As Single
Dim sngET As Single

sngStart = Timer
DoEvents
Do While sngET < psngSeconds
DoEvents
' check for mighnight as the Timer() function will
' rollover at this point
sngET = Timer - sngStart
If sngET < 0 Then
' it rolled over - add number of seconds
' in a day
sngET = sngET + 86400
Beep
End If
' now don't hog the processor
' release some CPU slices back to Windoze
DoEvents
Loop

End Sub

Hope that helps.

Jeremy

Nov 13 '05 #2
MLH
I just thought of something...
What effect on the processor does it have if
I open a form in a_dialog window mode that
closes itself in 10 seconds? That doesn't
load up the processor, does it?
Nov 13 '05 #3
MLH wrote:
I just thought of something...
What effect on the processor does it have if
I open a form in a_dialog window mode that
closes itself in 10 seconds? That doesn't
load up the processor, does it?


Shouldn't do no.

As well as my function posted by Jeremy, there's a Ain API call called
Sleep, this uses milliseconds but has one (possible) major drawback,
while it releases CPU slices to other applications it doesn't allow
Access to process any messages, which means you won't be able to press
any cancel button if you had one and while the app would sit there using
no CPU cycles it would appear as "not responding" in task manager.

--
This sig left intentionally blank
Nov 13 '05 #4
MLH
<snip>
Well, thanks to you both.
You sure helped me out!
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Mark Day | last post by:
Hi All, I am using Access 2000 to generate over 40 Excel charts and pivot tables using early binding to the Excel 9.0 object library. I am finding that if I show the Excel object while processing...
3
by: Phil Rutter | last post by:
Hello All, I have about 700 word documents that have 2 tables one is static 4 colums x 5 rows the other is 5 colums x rows ranging from 2 to 100 what i wolud like to do is open the word doc....
3
by: Iain Miller | last post by:
Can anybody help me with some Access 2000 code? I don't do a lot of coding in Access & so every time I come back to do something I pretty much have to relearn the syntax from scratch so this is...
11
by: ryan | last post by:
Hi, I've omitted a large chunk of the code for clarity but the loop below is how I'm calling a delegate function asynchronously. After I start the each call I'm incrementing a counter and then...
5
by: Soren S. Jorgensen | last post by:
Hi, In my app I've got a worker thread (background) doing some calculations based upon user input. A new worker thread might be invoked before the previous worker thread has ended, and I wan't...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
7
by: adamalton | last post by:
Hi, I'm building a site where the user enters some info into a form which submits to a php script. The php script takes a long time to execute (anywhere from 10 seconds to a minute) and when it...
5
by: Mahendra Kumar Kutare | last post by:
I am trying to implement a webserver with boss-worker model thread pool implementation - I have a header declaration threadpool.h as - typedef struct threadpool_work { void (*routine) ();...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.