Bar code scanners are available with three different connection
options. The first is called a "keyboard wedge" interface where you
unplug your keyboard, connect the bar code scanner to the keyboard
port on the PC and then connect your keyboard to the bar code scanner
cable so that you do not lose the original keyboard input. When you
scan a bar code, the data goes in as if it were being typed in on the
keyboard. This means that you would need to have a from open with the
cursor in a textbox where you would then scan (or type) the bar code
data into.
The second way that you can connect a bar code scanner is via a RS232
port connection. This would then require that you either write code to
read in the data directly from the RS232 port (a very messy thing in
Access) or use a tool like WinWedge from TAL Technologies to input the
data from the scanner directly to your applicaiton. This approach
provides a direct input from the scanner to your database so you would
not need any forms open when you scan bar codes however it does
require that you write some code that would first read in the data
from WinWedge and then process the data. The big advantage of this
approach is that you have complete control over the input of the data
and it does not matter where the cursor is or what forms are open when
you scan the bar codes. Your Access application can even be running in
the background when you scan a bar code and the data will still go to
the right place.
For more information on the WinWedge software please visit:
http://www.taltech.com/products/winwedge.html
WinWedge DDE samples for Access:
http://www.taltech.com/support/dde_sw/ddeaccess1.htm
http://www.taltech.com/support/dde_sw/ddeaccess4.htm
The third connection option is a USB interface. USB connected bar code
scanner come from the factory configured as USB keyboard devices that
work exactly like keyboard wedge scanners however most manufacturer
will also provide a replacement driver that you can install that will
create a "Virtual RS232 port" so that you can use the scanner with
programs like WinWedge. When you connect the scanner to the USB port,
the PC behaves as if it had a COM port (typicelly COM3 or COM4) and
any serial communications software would be able to read in the data
from the scanner through the virtual port.
You may also want to read the following articles:
http://www.taltech.com/products/interface.htm
http://www.taltech.com/resources/intro_to_bc/