L
LabGeek
I have an Access application that I have created that collects data
from a scanner and from a weighting scale. The data from the scanner
are unique identifiers (barcodes) and the scanner is connected as a
keyboard wedge. The data from the scale are weights and are collected
by com port using MScomm32.ocx.
A user will scan a barcode into a text box (linked to a table field)
and then weight a sample. The weight will be collected from the com
port and directly updated to the table. To insure the user that the
weight was successfully captured, I have included a listbox which
queries the table after each scale recording. This way the user can
see their data show up on the screen in a mock spreadsheet.
My problem is that about 1 in 100 barcode scans do not completely
read. I have traced this error to the requerying of the listbox
control. If a barcode is being read in at the same time as the
listbox is being updated, there is a slight chance of the text box (in
which the barcode is being entered) losing focus for a split second.
Since the computer sees the scanner as a keyboard wedge, it sends the
data to whatever has focus. When the text box loses focus, I lose
part of the barcode.
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better way
to run a query that doesn't take focus away from foreground processes?
Thanks.
from a scanner and from a weighting scale. The data from the scanner
are unique identifiers (barcodes) and the scanner is connected as a
keyboard wedge. The data from the scale are weights and are collected
by com port using MScomm32.ocx.
A user will scan a barcode into a text box (linked to a table field)
and then weight a sample. The weight will be collected from the com
port and directly updated to the table. To insure the user that the
weight was successfully captured, I have included a listbox which
queries the table after each scale recording. This way the user can
see their data show up on the screen in a mock spreadsheet.
My problem is that about 1 in 100 barcode scans do not completely
read. I have traced this error to the requerying of the listbox
control. If a barcode is being read in at the same time as the
listbox is being updated, there is a slight chance of the text box (in
which the barcode is being entered) losing focus for a split second.
Since the computer sees the scanner as a keyboard wedge, it sends the
data to whatever has focus. When the text box loses focus, I lose
part of the barcode.
Is there a way to maintain focus on the text box no matter what
background processes are running? Or better yet is there a better way
to run a query that doesn't take focus away from foreground processes?
Thanks.