Combo box and barcode scanning

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phill86
    New Member
    • Mar 2008
    • 121

    Combo box and barcode scanning

    Hi,

    I have a form with a number of combo box's the first combo box contains a barcode that is associated with user information then the next box contains a barcode that is associated with task information and so on...

    Basically what i need to do is scan the barcode and once the barcode is scanned automatically jump to the next combo box ready for the next barcode scan.

    I am trying to avoid the user having to press any keys to input data into the combo box's and just scan the barcode...

    I have tried the following code on the afterupdate and beforeupdate event with no success


    Code:
    Me.cbotaskid.setfocus
    which works fine if you "manually" select the record but it does not automatically move to the next combo box if you use the scanner

    Please Help

    Regards Phill
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    The AfterUpdate and BeforeUpdate events are triggered, usually, when the focus moves out of the field. For the behavior you want, you might use the Change event. Within the event code you can check if a full barcode has been entered, and if so, move to the next box.
    Code:
    If Len(firstComboBox.text) = lengthOfABarCode Then
      secondComboBox.SetFocus
    End If
    Hopefully, I am correct in assuming that scanning a barcode emulates typing a series of numbers into the fields. I don't know anything about bar codes, so disregard this if I'm completely off.

    Good luck,
    Chip

    Comment

    • Denburt
      Recognized Expert Top Contributor
      • Mar 2007
      • 1356

      #3
      I have worked with Scanners in the past and most have a setting that users can change so that once a barcode is scanned it will send an "Enter" or a "Return" I believe that some will even output a "Tab" this can easily be used to move to the next field. If your scanner doesn't have this option then you could fall back on to Chips idea as that would be your best option.

      Comment

      • JustJim
        Recognized Expert Contributor
        • May 2007
        • 407

        #4
        By coincidence, I am currently working on barcode implementation for a client. Are you creating your own barcode labels? What barcode system and what barcode font are you using? Do you use Access to produce the labels as well?

        It is perfectly reasonable to build one bar code that encodes "UserInformatio n"TAB"TaskInfor mation"ENTER" all at once.

        Jim

        Comment

        • phill86
          New Member
          • Mar 2008
          • 121

          #5
          Hi ChipR

          thanks for the reply I tried your code but now I am getting the error

          Run-time error 2110 "Can't move the focus to....

          Any ideas?

          Hi Just Jim no im not using access to create the barcodes at this stage the barcode font i am using is Free 3 of 9 Extended

          Any help is much appreciated

          Regards Phill

          Comment

          • ChipR
            Recognized Expert Top Contributor
            • Jul 2008
            • 1289

            #6
            It seems like this will happen if the value of the control isn't valid when you try to change the focus.

            Comment

            • DanicaDear
              Contributor
              • Sep 2009
              • 269

              #7
              I like the IDAutomation font. It's a free download. It has provided better barcodes than the Free 3 of 9 font. You can print your barcodes in Access by simply making a control on the form and changing the font to your barcode font. Keep in mind most barcodes have to have an asterick * before and after them. So in the control you might need this: ="*" & [YourFieldName] & "*"

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                We solved a similar problem by programming the barcode reader to append a newline(you could use any special character probably) and based on that we knew when to jump locations

                Comment

                Working...