|
Subject:
|
getting a cr with bar code scanner
|
|
Posted By:
|
dbkester
|
Post Date:
|
10/21/2003 10:28:30 AM
|
We have set up a helpdesk database in Access 2002, to track tickets on a student run support desk. We are instituting a bar code system with each laptop being coded, so that we don't need to key in a large amount of information (or deal with typos). The difficulty we are encountering is that we can get the database to accept the bar code data from the hand scanner, it will populate the control as instructed, but are having trouble automating an "after update" event. We still need to manually hit the enter key. Does anyone have a suggestion as to how to automate the carriage return, so that the new ticket form is opened in a single step as a result of scanning the bar code?
|
|
Reply By:
|
sal
|
Reply Date:
|
10/21/2003 11:32:14 AM
|
Try moving focus to another object on your form. This should have the same effect as hitting enter
Sal
|
|
Reply By:
|
Braxis
|
Reply Date:
|
10/21/2003 11:32:16 AM
|
Do your barcodes have a fixed length?
If so, set the Auto Tab property of the textbox accepting the scanned code to true. Once the text box is full, the focus will automatically go to the next control and its AfterUpdate event will fire.
Brian Skelton Braxis Computer Services Ltd.
|
|
Reply By:
|
blouderback
|
Reply Date:
|
10/22/2003 9:01:32 AM
|
Hi DB!
We are having a similar problem with our Access Database and a Symbol barcode scanner. I've tried setting the scanner suffix to CR, CR/LF, LF, NONE, HT, ETX. None work in Access, but it DOES work in notepad (the scanner reads the barcode and then does the Carriage Return). We always have to press the ENTER key after scanning in Access, and it's really annoying!
Anybody have any ideas?
-Bob
|
|
Reply By:
|
dbkester
|
Reply Date:
|
10/30/2003 5:30:11 PM
|
Bob;
We still haven't made any progress. It has stumped a lot of people. I was hoping that someone here could help. I'll keep trying and let you know if we find a solution.
|
|
Reply By:
|
Steven
|
Reply Date:
|
11/3/2003 7:16:31 PM
|
While is sounds to me like the AutoTab solution mentioned by Brian should work, here's another possible workaround (and I'm not sure that this will work given that it's getting input from a scanner, not from the keyboard)
On one of the Key events (Down, Up or Press - I'd suggest trying them all), if the KeyCode is 13 (the ascii code for Enter) or possibly 9 (the ascii code for Tab), move it to the next txtbox.
So you have something like...
Private Sub txtField_KeyPress(KeyAscii As Integer)
If (KeyAscii = 13) Then MsgBox "Yay It Works!"
End Sub or
Private Sub txtField_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then MsgBox "Yay It works!"
End Sub
HTH
Steven
I am a loud man with a very large hat. This means I am in charge
|
|
Reply By:
|
bjmcdaniel
|
Reply Date:
|
11/15/2004 10:17:45 AM
|
I am having the same problem trying to switch fields. Unfortunately I do not have fixed length fields, and do not know much about VB. Has anyone had any luck with this, I have searched everywhere and seemed to have tried everything.
|
|
Reply By:
|
Clive Astley
|
Reply Date:
|
11/16/2004 9:38:06 AM
|
Haven't tried this in Access. But I recently did it in VB6. My scanner appears to automatically put an Enter after reading the barcode into a textbox. So I just put a hidden command button on the form with its default property set to True. Now as soon as the scanner scans something the code behind the hidden command button runs.
Hope this helps.
Clive Astley
|
|
Reply By:
|
Clive Astley
|
Reply Date:
|
11/16/2004 6:22:25 PM
|
I have now tried the following in Access97 and it works.
Make a blank form with two text boxes - Text1 and Text5. Text5 must appear immediately after Text1 in the Tab Order
Text5 cannot be hidden because otherwise it cannot get the focus. But it can be made to blend into the background so that it looks invisible.
Text5 has the following event property:
Private Sub Text5_GotFocus() MsgBox Text1 Text1 = "" Text1.SetFocus End Sub
Hope this helps.
Clive Astley
|
|
Reply By:
|
girlygeek
|
Reply Date:
|
4/21/2006 10:11:29 AM
|
I'm running embedded VB 3.0 with a Symbol pocket pc... I too have a hidden command button on my form, with the default property set to true...however, I'm noticing that when I scan a barcode, the code behind the command button is executing twice... Anyone know how to get around this?
|