Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2003, 10:28 AM
Registered User
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default getting a cr with bar code scanner

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?

 
Old October 21st, 2003, 11:32 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try moving focus to another object on your form. This should have the same effect as hitting enter

Sal
 
Old October 21st, 2003, 11:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old October 22nd, 2003, 09:01 AM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old October 30th, 2003, 06:30 PM
Registered User
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.


 
Old November 3rd, 2003, 08:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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...
Code:
Private Sub txtField_KeyPress(KeyAscii As Integer)
If (KeyAscii = 13) Then MsgBox "Yay It Works!"
End Sub
or
Code:
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
 
Old November 15th, 2004, 11:17 AM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old November 16th, 2004, 10:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old November 16th, 2004, 07:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old April 21st, 2006, 10:11 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to integrate a hand-held bar code scanner suneet.pant Pro VB.NET 2002/2003 4 March 4th, 2008 06:06 AM
Hide Task bar through vb6 code akhilesh_g Pro VB 6 6 December 28th, 2007 01:23 PM
Bar Code Scanner dartcoach VB How-To 4 December 1st, 2006 10:13 PM
bar code+asp kumiko Classic ASP Basics 0 August 26th, 2006 10:30 AM
Problem printing bar code! cyberrider VB How-To 1 November 5th, 2005 04:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.