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

slow a code down

Status
Not open for further replies.

dead7

Programmer
Jun 8, 2004
79
US
I have this code and it runs this winbatch program. I want it to loop thru the records in this subform. But its running to fast, I thought the timerinterval would slow it down but it is not working. Also when the code gets to the last line when I want it to stop where theres a false (its a check box column) it says copy is not available, probably cause the field Im saying to copy from is blank. How can I fix that and to pause till the exe program finishes doing its thing.


Dim stAppName As String

Do
Forms![frmClaimHead-Line_RR]![frmMASHead_RR subform].SetFocus
DoCmd.GoToControl "claimhead"
DoCmd.RunCommand acCmdCopy


'This Runs the Macro exe application MASCLAIM.exe
stAppName = "C:\Documents and Settings\023Q\Desktop\MASClaim.exe"
Call Shell(stAppName, 1)

Me.TimerInterval = 50000 ' milliseconds -> 1 second

DoCmd.GoToRecord , , acNext


Loop Until Forms![frmClaimHead-Line_RR]![frmMASHead_RR subform]![APPEALED] = False
 
Code:
...
Dim dblRandomVariable as Double
...
dblRandomVariable = Shell(stAppName, 1)
...

This should stop the procedure until [tt]Shell()[/tt] has done it's thing.

Hope this helps,
CMP

(GMT-07:00) Mountain Time (US & Canada)
 
How are ya dead7 . . .

Maybe this will help:

How to determine When a Shelled Process Ends

Calvin.gif
See Ya! . . . . . .
 
caution,
where do I put that in my code
 
Dimension the variable at the top of your procedure,
replace the [tt]Call Shell(...[/tt] with [tt]dblRandomVariable = Shell(...)[/tt].

If this doesn't slow the code down enough look at the API calls that AceMan1 pointed to.

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top