Can I fire a trigger based on OCR input?

willknapp

Registered User.
Local time
Today, 05:18
Joined
Aug 16, 2012
Messages
93
I got a real noodle scratcher here...

I've got a form that parses a data string into individual records, and inserts them into a table. Currently, the string is pasted into a text box, and the user must click a button to begin the parse/insert process.

My client recently informed me that the string is automatically inserted by third party OCR software, and he'd like to automate the process - i.e., save the user from having to click the command button to fire the sub code.

Does anyone have any experience trapping an event like this? I've tried before/after updates, etc., but they still require some kind of user interaction - tab out, a key stroke, which the client is trying to avoid. He likes the existing functionality - it's just a preference, so I told him I'd fish for some answers.

Thanks!
 
You might try playing with the Timer Event and watching the TextBox for changes. Unfornately the "events" are all *user* events and not designed to fire with code.
 
The way I see it, you need to know when the input stream ends:

In OnChange, you can run something for each characeter entered. If you have some criterion for when the last one is entered then you are done. Counting them , or some special character added by the OCR s/w.

Or, convince the OCR to add a RETURN at the end of the stream

How exactly does the OCR s/w "automatically insert" the string? If it does some sendkey magic, it could also send a RETURN
 
Right now, the OCR returns a string "x1,y1,z1;x2,y2,z2; etc." with commas as a field separator and semi-colons as the record separator. The string ultimately ends with a semi-colon. But my guess is, as spikepl suggests, that the OCR software can be updated to add some sort of "End Of Line" character that could trigger an event via OnChange. I'll have to check with the client. Thanks for the ideas, folks!
 
The client confirmed that there is a carriage return at the end of the string - I'll give it a test and post the code if it works (in case anyone else faces this dilemma...)

Thanks everyone!
 

Users who are viewing this thread

Back
Top Bottom