Need something akin to a timed interrupt (1 Viewer)

peskywinnets

Registered User.
Local time
Today, 13:29
Joined
Feb 4, 2014
Messages
567
I still consider myself fairly entry level at VBA (a complete kludger), as such I'm not particularly well versed in all the tools available in the VBA toolbox (&/or how to deploy), so please let me explain what I need...and perhaps some kind soul will tell me if it exists....

I'm prompting for user input, with something like this...

Code:
ScanBarcode = InputBox("Now Scan the PRODUCT Barcode")

So the code will just sit there until a user enters something ...what I need is something that is timing how long it's been since arriving at that line of code ....& then if it breaches say 5 seconds, to break out & beep (I chose beep for simplicity) ...therefore I need a background timer that triggers an interrupt...does such a combo exist?
 

isladogs

CID VIP
Local time
Today, 13:29
Joined
Jan 14, 2017
Messages
14,974
Normally you would use a timer event which runs every second (timer interval = 1000) for a task like this
However, an input box is modal and all code is paused until after the user enters something.

To get this to work, I think you need to abandon the standard input box and create your own form so you can use a timer event
 

peskywinnets

Registered User.
Local time
Today, 13:29
Joined
Feb 4, 2014
Messages
567
Ok, thanks...I'll need to attack this differently then :)
 

isladogs

CID VIP
Local time
Today, 13:29
Joined
Jan 14, 2017
Messages
14,974
Yes I believe so.
Create your own form to simulate an input box but make sure you set it up so other code can run in the background
 

Users who are viewing this thread

Top Bottom