Results 1 to 5 of 5
  1. #1
    euphonium01 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    40

    Smile Splitting Data Using A Scanned Bar-code Entry

    I am able to scan a bar-code and get the data the scanner reads into the correct field. However, the numbers that appear from the bar-code are a 9 digit, numerical number (say 123456789). Although the numbers scanned are correct, I want to 'split' the numbers into 3 digits in one field, and the remaining 6 digits into another field (so field 'A' would contain 123, and field 'B' would contain 456789).

    The answer maybe fairly simple but, after searching for the right answer for some time, it seems to be a pretty unique question, can anyone help please?

    Thanks in advance


    Paul (euphonium01)

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    How are you planning on storing the data; in one Field or in two Fields? Exactly how you do this will depend on the answer.

    Scanning the data in is considered, by Access, to be the same as entering it in manually, which is to say the usual events (OnChange, AfterUpdate, etc.) are triggered. You can use this to parse the barcode into the two Fields (if you're storing two Fields) or use the Control Source of the two to do the parsing if you're only storing the one, complete, Field.

    Linq ;0)>

  3. #3
    euphonium01 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    40

    Smile

    I am wanting to store the data in two fields, I have just scanned a typical bar-code in, it reads 114283535, the 114 determines what my product, the 283535 tells me the Serial Number of that product. So, I need field TYPE to have 114 in it, and I need field SERIAL to have 283535 in it.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    This should do it, replacing txtScannerControl, txtProductName and txtSerNumber with the actual names of your Controls:

    Code:
    Private Sub txtScannerControl_Change()
     Me.txtProductName = Left(Me.txtScannerControl, 3)
     Me.txtSerNumber = Right(Me.txtScannerControl, 6)
    End Sub


    Normally you'd use the AfterUpdate event for this kind of thing, but because you're using a scanner the OnChange event should work fine, assuming that you'll never be manually entering the barcode. If that is a possibility, use the txtScannerControl_AfterUpdate(), instead.

    Linq ;0)>

  5. #5
    euphonium01 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    40
    Worked like a dream, thank you so much

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

Similar Threads

  1. Replies: 5
    Last Post: 03-09-2014, 07:16 PM
  2. Linking Scanned Documents (pdf)
    By ajolson1964 in forum Access
    Replies: 2
    Last Post: 05-11-2011, 04:29 PM
  3. scanned signature(s) on a report
    By thedoc44 in forum Access
    Replies: 7
    Last Post: 09-15-2010, 10:54 PM
  4. Splitting Data
    By thesaguy in forum Access
    Replies: 4
    Last Post: 08-19-2010, 02:43 PM
  5. Replies: 3
    Last Post: 08-08-2010, 01:10 PM

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