How do I send an escape key to combat err 2113 invalid data on a touch screen

B

Bobby

Hi,
I am using Access 2003 with XP.

I have an application which uses a touch screen and bar code reader.
The p/c does not have a keyboard or mouse.

Somehow, the user keeps inputing incorrect data, and gets the message
"The value you entered isn't vaild for this field" (i.e. error number
2113). He doesn't know how he is doing it, and I can't see the invalid
data on the screen. However, if I plug a keyboard in and press the
escape key, it fixes the problem.

So, easy solution I thought, simply go to the on error event of the
form and capture any error 2113, and use sendkeys "{ESC}" to send the
escape key. However this only kind of works. Firstly, I had to send the
{ESC} key twice. Now it works if if I press the tab key, but if the
user presses a button on the screen (equivelent to using the mouse), it
still doesn't work.

So, if the error 2113 occurs, what is the best way to hit the escape
key, or tell the form to cancel incorrectly input data?

Not sure I've explained myself very well, but thanks for any help,

B
 
B

Baz

Bobby said:
Hi,
I am using Access 2003 with XP.

I have an application which uses a touch screen and bar code reader.
The p/c does not have a keyboard or mouse.

Somehow, the user keeps inputing incorrect data, and gets the message
"The value you entered isn't vaild for this field" (i.e. error number
2113). He doesn't know how he is doing it, and I can't see the invalid
data on the screen. However, if I plug a keyboard in and press the
escape key, it fixes the problem.

So, easy solution I thought, simply go to the on error event of the
form and capture any error 2113, and use sendkeys "{ESC}" to send the
escape key. However this only kind of works. Firstly, I had to send the
{ESC} key twice. Now it works if if I press the tab key, but if the
user presses a button on the screen (equivelent to using the mouse), it
still doesn't work.

So, if the error 2113 occurs, what is the best way to hit the escape
key, or tell the form to cancel incorrectly input data?

Not sure I've explained myself very well, but thanks for any help,

B

This isn't directly an answer to your question, but if I were you I would
add some diagnostics to try to get at the source of the problem.

In the form's error event, you could try using Screen.ActiveControl to find
out which control/field is the problem, and what value is being "entered".
If this works, it might tell you what you need to know to prevent the
problem.
 
B

Bobby

Baz said:
This isn't directly an answer to your question, but if I were you I would
add some diagnostics to try to get at the source of the problem.

In the form's error event, you could try using Screen.ActiveControl to find
out which control/field is the problem, and what value is being "entered".
If this works, it might tell you what you need to know to prevent the
problem.

Thanks. Me.ActiveControl.Undo seems to do the trick, though as you say
it's not really fixing the problem. However, I can implement this fix
for now, but also include some diagnostics to try to get to the bottom
of the problem.

Thanks again

Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top