One way to do this it to keep a hidden form open in the background to
detect when a barcode has been scanned. If you're using keyboard wedge
type scanners, (simplest), you'll need to differentiate between a
barcode and regular keyboard input. You can do this, with code 39, by
intercepting the '*' characters at the start and end of the barcode, and
parsing out the contents. (Don't forget to configure the scanner to
transmit start / stop characters). The logic here is that when a '*'
character is intercepted, the program expects the following characters
up to the next '*' to be a barcode.
Private Sub Form_KeyPress(KeyAscii As Integer)
If bnInBC Then
' we are currently processing a barcode
If KeyAscii = 42 Then
' asterisk entered so stop processing
bnInBC = False
Call ProcessBarcode
strBarcode = ""
Else
' concatenate
strBarcode = strBarcode & Chr$(KeyAscii)
End If
KeyAscii = 0
Else
' start processing barcode if needed
If KeyAscii = 42 Then
KeyAscii = 0
bnInBC = True
End If
End If
End Sub
You'll have to have a timer to exit in case of a bad read of if someone
enters an asterisk from the keyboard. You should be able to find plenty
of code examples to do this. You can also compute a checksum to verify a
good read.
You can develop a prefix library to differentiate the various types of
things that can be scanned, e.g.
'ID' = employee ID
'SI' = stock item and so on
Then you can build up the barcode identifiers using the prefix and an
internal ID, e.g 'ID00123' for an employee. I like to pad numbers with
zeros - it helps when sorting and it just looks nicer when all your
barcodes have the same width.
nm********@gmail.com wrote:
Hi,
I am in the design phase of building a database that will track the
productivity of my warehouse. I am thinking of using a barcode
scanner to assist me with this. Employees will hopefully be scanning
a barcode which will communicate to the computer that the employee did
some type of task. Employees will be identified by ID badges which
will contain string data to identify them and hopefully log them in.
Is this a good way to keep track of tasks or is another way better?
Keep in mind that we want to change the job as little as possible and
we want to have minimal user interface(I want things to be automated
so people do not have to use the computer). Also, as far as ID's go is
access capable of recognizing individual scanners as identification if
I code it to do so? In addition, is access capable of letting
multiple people use the database at one time to enter their barcodes?
In other words, can I have multiple people doing the same thing at the
same time but with different ID's? Thanks in adavanced for any help
provided!!