Results 1 to 7 of 7
  1. #1
    IannWard is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    16

    Edit results when Scanning a Barcode (serial number) into a form.

    Hi

    I have created my first database to log serial numbers of certain devices. Device 1 has a 12 digit serial number which is fine, but device 2 has an 18 digit number with a few letters in the middle. Is there any way, when scanning the barcode in to a form, that access recognises it as an 18 character serial number but ignores the first 6 digits to just display the last 12?, also if it is a 12 digit serial number from device 1 it just displays all characters?



    Hope this makes sense..

    Many Thanks

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    My suggestion is to scan it into an 18 digit control field, and use the onchange event of the control to calculate the 12 digit code into another field.

  3. #3
    IannWard is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    16
    Thank you for your quick response. That sounds great, but as a newbie, could you explain a little more about a control field and onchange event please.

    Thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    A control is something you put on a form - textbox, combobox, button, label are all controls of various types.

    I think Dal meant scan the barcode into a textbox control that is bound to a field. An expression in another textbox can extract the 12 characters, like:

    =IIf(Len([scan box name])=18, Mid([scan box name],7), [scan box name])

    If you want to save that calculated result to table, will require code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Pretty much. Your barcode scanner needs to put the scan results into a field. I cant tell you how to do that, because it's basically a hardware thing.

    Let's say it's a textbox that's getting the results, and the name of the textbox is txtBarInputCode.

    In the txtBarInputCode_Change event, you will have code that deits and strips down the value that just got loaded into the textbox, and inserts that calculated value into another control. The OTHER control is the one that will be bound to the database field.

    Now, not knowing what you are going to DO with the data, I can't tell you how that code needs to look.

    My suggestion is, first step, figure out how to get the barcode to scan its result into a field on a blank form. Until you can get it to do that, without triggering anything, you really can't do anything at all.

    Once you know how to make the scanner input something, then the rest should be really easy.

  6. #6
    IannWard is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    16
    Quote Originally Posted by June7 View Post
    A control is something you put on a form - textbox, combobox, button, label are all controls of various types.

    I think Dal meant scan the barcode into a textbox control that is bound to a field. An expression in another textbox can extract the 12 characters, like:

    =IIf(Len([scan box name])=18, Mid([scan box name],7), [scan box name])

    If you want to save that calculated result to table, will require code.

    Hi

    I scan the barcode into an unbound text box and it displays like this 29384PP71161047. But I only want the numbers after the two P's. All my serial numbers in the database are just the last 8 digits (this is because another database in the company displays them this way, so I wanted to keep them the same in mine), but when I scan the barcode, I have to manually delete the first 7 characters before I can then hit search to find the serial number and other data linked to it. If that makes sense....

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Did you try the suggested expression and code to save?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Automatic Serial Number in Report
    By jamil_kwi in forum Reports
    Replies: 11
    Last Post: 01-19-2015, 11:09 AM
  2. Replies: 4
    Last Post: 08-11-2014, 01:18 PM
  3. Employee time clock with barcode scanning
    By trevor40 in forum Programming
    Replies: 2
    Last Post: 03-26-2014, 10:54 PM
  4. Replies: 6
    Last Post: 03-21-2012, 07:13 PM
  5. Processor Serial Number
    By Azeez_Andaman in forum Programming
    Replies: 2
    Last Post: 08-16-2011, 11:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums