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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Waiting In Access Problem

Status
Not open for further replies.

JesseH

MIS
Aug 9, 2001
63
0
0
US
I need to stop processing in Access to allow AutoCAD to create a drawing. I looked in the Microsoft support and they have a wait routine. When I use that, Access will use most of the CPU cycles to execute the wait routine. This leaves very little CPU to execute AutoCAD creating a Catch-22. The process is taking an inordinate amount of time.

Does anybody have routine or methodology to make Access wait without tying up the processor?

Thanks in Advance
 
Try this:

Public Declare Sub Sleep Lib "Kernel32" (ByVal dwMS As Long)

Sleep (5000) 'Pause for 5 seconds
 
Dear FancyPrairie,

Do you have a coding example using this. I can not seem to make it work.

You can email me at hernandj@eim-co.com

Thanks for your help.
 
For a test, create a new module and insert the following code. Then, via debug's immediate window, type CheckSleep
Code:
Option Compare Database
Option Explicit

Public Declare Sub Sleep Lib "Kernel32" (ByVal dwMS As Long)

Function CheckSleep()

 MsgBox "Going To Sleep"
 Sleep (5000)
 MsgBox "I'm awake now"
 
End Function
 
JesseH

Sleep 5 seconds may not be enough.

Another example is presented in Access Cookbook (publiher: O'Reilly, Authors: Getz, Litwin, Baron, ISBN: 0596000847, Topic 11.5 - Run another program and pause until done.) I am not sure about copywrite issues, so I will let you research this one.

Also some code in the public domain by Terry Kreft...

Richard
 
apparently "Doevents" will fix the problem as i understand it.

stick it in your code directly after the bit that does the drawing. the help file alledge that access will wait until all cpu tasks are completed and pick up where it left off.

i cant get it working on a chart update, but others in other forums ahve mad it work.

Mike C
 
Thank you guys very much. It worked.
I did a combination of things. I used the sleep option with a varible number of second where I needed it. Also, if the known file had not been created yet, I would sleep again(loop) until it was created.

Thanks again for the help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top