+ Reply to Thread
Results 1 to 10 of 10

Check barcode scanning

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Check barcode scanning

    Hi Guys,

    I have a code in userform which I use to transfer data from one sheet to another when the barcode is scanned into the userform textbox(txtOrder), the barcode with order number contains 6 digits .

    I have another textbox in userform called txtOperator, this textbox is also filled when scanning the barcode but now it contains only two letters.

    So my issue is if not correct textbox is selected by operators it my cause barcode to scan into wrong textbox, lets say that order number will be scanned into operators textbox(txtOperator) and off course it could be in opposite way.

    This is what i would like to achieve:

    http://www.ozgrid.com/forum/showthread.php?t=193782
    http://www.mrexcel.com/forum/excel-q...ml#post4108698

    1.txtOperator textbox - Check if barcode contains 2 letters and if it is true leave it in a txtOperator textbox, but if it's more than 2 scan into txtOrder
    2.txtOrder textbox - check if barcode contains more than 2 letters and if it is true leave it in txtOrder textbox, but if it's equals 2 letters scan into txtOperator

    Below is my code and i also attached the file.

    Thanks in advance for your help.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by intex; 03-25-2015 at 02:22 PM.

  2. #2
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Check barcode scanning

    Please guys, any one have any ideas how to achieve this?

  3. #3
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: Check barcode scanning

    Hi,Intex
    your code is too complicate to me, so, i've reduced it, hope you can like it.
    Attached Files Attached Files
    Last edited by simcode; 03-22-2015 at 11:23 AM.

  4. #4
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Check barcode scanning

    Hi simcode,

    Great thanks a lot for your help it looks much better now. It almost does what i need

    There is a still main issue, when i use the "Len" it executes the code when the first two letters or digits appear in textbox, maybe there is a way to pause the code for second or half second (just to give some time to scan fully the barcode) and then do as below?

    If Len(UserForm1.txtOrder) = 2 Then
    copy what is in this textbox and paste into txtOperator and then clear the txtOrder,
    but If Len(UserForm1.txtOrder) = 6 Then
    proceed with the full code and also


    If Len(UserForm1.txtOperator) = 2 Then
    leave as it is and then select the txtOperator
    but
    if Len(userform1.txtOperator) = 6
    copy what is txtOperator into txtOrder and then clear txtOperator

  5. #5
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: Check barcode scanning

    Hi, intex
    Textbox 'txtOrder' should contains 6 letters, do you think it's a good idea to change textboxes' value when it has only 2 letters? Why could not wait.
    Certainly, you are the boss, as you wish, i've changed the code, hope you can like it.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Check barcode scanning

    Hi Simcode,

    Yes you are right it would be much better to wait as now it transfers data from txtOrder to txtOpertor when only two digits typed in.

    I just trial it today at work and found one more issue.

    At work I have two types of barcode one is 6 digits and second one is 8, lets say order number "111111" and "11111100" the only difference between them is that second one has two zeros at the end.

    Is it possible to specify in a code always to look for first digits only, because now when I'm scanning the 8 digit barcode it transfers data to sheet as it should be and then leaves those last zeros in txtOrder and that is causing that "Order Scanning ok" textbox doesn't show up and also the "TextboxReadytoChange" not working because it has only two digits in txtOrder.

    Thanks in advance for all your hard work, but would really appreciate if you can help me to resolve this issue.
    The below image is how it acts now:
    Untitled.jpg

    This image shows how it should be:
    Untitled1.jpg

  7. #7
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: Check barcode scanning

    Hi, index,

    I'm no clear, if we can work with 6 digits, why input eight. How can the computers judge two zeros are the parts of the next barcode or should be ignored, except it never begin with "00".

  8. #8
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Check barcode scanning

    Hi simcode,
    Maybe it is possible to delay change event in the txtOrder (maybe for 1 second) just to give some time to scan the full barcode into txtorder?
    And then run the full code. My problem is that custom orders barcode have 8 digits and the standard ones have 6 digits. How we can get around this?

    Thanks a lot

  9. #9
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: Check barcode scanning

    Hi intex,
    How about this one.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Check barcode scanning

    Thanks a lot mate it works like it should be now.

    You perfect!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Issues with barcode scanning
    By qmccain in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-31-2015, 01:34 AM
  2. Switch between worksheets by scanning a barcode
    By Drake2007 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-17-2014, 06:26 PM
  3. barcode scanning template
    By donkey_uk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2013, 12:19 PM
  4. Barcode Scanning - Library
    By _LG_ in forum Excel General
    Replies: 1
    Last Post: 12-05-2011, 11:55 AM
  5. [SOLVED] does excel support barcode scanning?
    By Jase in forum Excel General
    Replies: 8
    Last Post: 12-07-2005, 06:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1