Access 2003 - BarCode Scanning

Posted on 2011-04-29
Last Modified: 2012-06-21
Done a fair amount of work in Access and this one is stumping me.  I have a simple database nothing elaborate just a reg table with a form linked to it.  The table has 4 fields and each field is inputed via a barcode scan from a USB scanner.  The first field goes in fine and the cursor goes to the next field.  When i do the second scan it shows the information going into the field but it does not hold it.  The field is empty.  Even if a do a new table and set it up using datasheet view and start scanning data it does the same thing.  The only way i can get it to work is if i double click on the 2nd field before scanning and then it works.  Any ideas would be greatly appreciated.
Question by:Hockeynut57
    LVL 56

    Expert Comment

    by:Jim Dettman (Microsoft MVP/ EE MVE)
    <<Any ideas would be greatly appreciated.>>

    1. Check the prefix/suffixes the scanner is sending (if any).
    2. Check the Access Keyboard options that are set (Tools/Options):

        Move after enter
        Behavior entering field
        Arrow key behavior
        Cursor stops at first / last field.

      Typically, you want a gun to issue a CR (Carriage Return), which will be seen as an enter key to move between controls.  You can also use a tab character.


    Author Comment


    I checked the items thanks,had already checked the scanner.  Let me make it a little more interesting.  I have 3 fields and just discovered, that the first one scans and accepts no problem, the second one scans sees the data but doesnt save it and the 3rd one scans and saves the data.  It doesnt matter the data i scan either as i have scanned the items that stay in 1 and 3 but they wont stay in 2.  Is there anyway that i can have script to tell teh field to double click itself and that should fix the problem.
    LVL 56

    Accepted Solution


      Did you check the field that control 2 is bound to?  Is it large enough and a text type so it can receive the data?
      Can you type into the field normally and tab or enter to the next field OK?  In other words is it updateable?

      Can you do that with all three fields on the form (enter data and tab or enter to the next control)?

      I would also double check the tab order.  Focus may not be moving as your expecting it to.

      Last, you can put code set the forms keypreview property to true, then place a stop in the Keydown and Keypress events of the form to see the data that is coming in from the gun.  

      Keep in mind that Access doesn't know where the data is coming from; keyboard or gun.  It's just seeing input.  Either the gun is sending incorrectly or the form is not handling it correctly.


    Author Comment

    It appears to be the scanner causing the issue somehow, even though i reset it and checked the settings it was still acting up.  I changed the scanner and it worked fine.  Thanks for the help going to accept the above solution as it sorta pointed me back there again.  Thanks everyone for the help

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now