Bar Code Scanning ...

cheer

Registered User.
Local time
Today, 23:22
Joined
Oct 30, 2009
Messages
222
There is one text box on a form. How to allow the text box to accept value through bar code scanning ONLY and through keyboard ?
 
Doesn't your barcode scanner hook up through you keyboard?
 
Doesn't your barcode scanner hook up through you keyboard?

Yes. My question above is how to allow text from bar code scanner ONLY and not from keyboard ?
 
I believe your barcode scanner inserts a special character after scanning any code, so you could use that to determine if the input was from the barcode scanner or not and write your code around that. The right() function should come in handy.
 
To prevent all input from the keyboard
Code:
Private Sub ScannerFieldName_KeyDown(KeyCode As Integer, Shift As Integer)
  KeyCode = 0
End Sub
If you'll need to Tab out of the field, after the scan
Code:
Private Sub ScannerFieldName_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode <> vbKeyTab Then
  KeyCode = 0
 End If
End Sub
I don't have a scanner to test this, but I don't believe input from the scanner will be interpreted by Access as actual keystrokes.

Linq ;0)>
 
I don't have a scanner to test this, but I don't believe input from the scanner will be interpreted by Access as actual keystrokes.

The scanners that I have seen actually do emulate a keyboard so it would be coming across as keystrokes.
 

Users who are viewing this thread

Back
Top Bottom