Have System trigger the keyboard "Enter Key" when a data field is populated

A

anonymous

Hi,
I want to add code to have MS Access automatically trigger
the keyboard "Enter Key" command when the user populates a
data field. I have a bar code scanner attached to the pc
and the user will scan the barcode which will be populated
into a data field I have on the access form. Now, instead
of the user pressing the "Enter Key" on the keyboard or
clicking on a button after scanning the barcode, I want
to call a function to trigger the enter key on the
keyboard so I can display the info for that scanned
barcode.

Thanks,
 
S

Sam Hobbs

You did not specify what the keyboard "Enter Key" does in your form, and
what it does is important. I will attempt to guess at what the enter key
does in your form.

My guess is that the enter key causes a button to be "pushed" (clicked). If
I were using another language in which Windows messages are typically sent
from, then I would send a message to the form that tells the form that the
button was clicked. Specifically, it is a BN_NOTIFY command message. I am
not sure it is possible to do that using Access Basic, but it probably is
possible somehow.

Since it has been nearly a week, you might already have solved the problem.
If you are interested in more details, then say so. I don't look at this
newsgroup everyday but I hope someone helps if you need it.
 
S

Sam Hobbs

Actually there are many ways this can be done. Do you have code or a macro
that is executed when the button is clicked (the enter key pushed)? If so,
then you can do one of the following:

- call the OnClick code or macro (I am not sure that would work but I am
nearly certain)

- copy the code from the OnClick code into the processing that reads the
scanner data and execute that instead of sending the enter key.

- copy the code from the OnClick code into a common procedure or
function and then execute that other procedure from the OnClick code and
from
 

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