[AccessD] Timer Routine needed - or some other solution?

Dan Waters dwaters at usinternet.com
Wed May 5 11:49:28 CDT 2010


Hi Rocky,

First, declare this API in a module.

	Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)

To use it, just enter this line in your code:

	Sleep 30000

to pause code execution for 30 seconds.  The Sleep function uses
milliseconds.

HTH!
Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Wednesday, May 05, 2010 11:16 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Timer Routine needed - or some other solution?

Dear List:

The problem is that mdb 1 calls a module in mdb 2 which prints 4-5 reports -
to a network printer.  The user wants those reports to come out in a
specific order, so the module calls them in that specific order.  But when
the reports print, they come out in a different order - random or scrambled
according to the user.

So user asks me to write some kind of timer routine that would delay the
call to the next report by 30 seconds.  Now the calls are in a module so I
can't use the timer event.  A nice tight loop checking the computer's clock
would work except it might suck up so many machine cycles the reports might
not get printed.  In any event, not much else would go on in that machine
while it was running the loop.

I asked him to take the printer off line and look at the queue to see what
order the reports are in there, but can't get him to do that.  

Asked him to hook up a local printer and see how the reports come out and,
if scrambled, take it off line and see what the queue looks like.  But he's
really insistent that the first thing we try is to program our way into an
orderly report printing.

I did get him to concede that he could put the report printing code in a
module behind a form in which I could embed a timer event.  

So, what to do?  I'm looking at a minimum for a way to separate the printing
of the reports in the module (he tried DoEvents but that didn't help) by 30
seconds or so.  If by some miracle that works, then problem solved.  If it
fails then maybe I can get him to look at another approach.

MTIA

Rocky





More information about the AccessD mailing list