Results 1 to 8 of 8
  1. #1
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188

    Generate SSCC data

    Does anyone have a module they use for generating GS1-128 data?
    I believe it's a 20 digit string based off our GLN + SerialNumber + Check Digit


    I would've like to think Google would turn up something, but failing.

    Thanks!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    From GOOGLE: https://www.google.com/search?client...-d&q=sscc+code

    The Serial Shipping Container Code (SSCC) is an 18-digit number used to identify logistics units. In order to automate the reading process, the SSCC is often encoded in a barcode, generally GS1-128, and can also be encoded in an RFID tag. It is used in electronic commerce transactions.

    Hope it's helpful.

  3. #3
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    Quote Originally Posted by orange View Post
    From GOOGLE: https://www.google.com/search?client...-d&q=sscc+code

    The Serial Shipping Container Code (SSCC) is an 18-digit number used to identify logistics units. In order to automate the reading process, the SSCC is often encoded in a barcode, generally GS1-128, and can also be encoded in an RFID tag. It is used in electronic commerce transactions.

    Hope it's helpful.
    Yes, I know what it is. I just need a way to calculate the check digit in an MS Access query. I'm sure there's a function floating around somewhere. Just having trouble finding it.

    Thanks!

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    so it's just the check digit calculation you need? https://www.excelforum.com/excel-for...n-formula.html

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    plenty of hits on google, here's another one https://www.excelcommand.com/excel-h...o.php?i=391709

    sure you can use that to write your own function

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    ms access vba solution, complete with db sample, posted here
    http://www.vbaexpress.com/forum/show...it-Calculation

    I'm not a member so I can't validate.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I did a mock up based on some links I found and the morovia link by ajax in post 8.
    I have no experience with SSCC codes.
    You can modify and confirm the logic with examples you are working with.

    Code:
     ----------------------------------------------------------------
    ' Procedure Name: ssccChk
    ' Purpose: Sample procedure to validate sscc-18 via check digit
    ' Procedure Kind: Function
    ' Procedure Access: Public
    ' Parameter sampleCode (String): The 18 digit SSCC code to be checked
    ' Return Type: Integer
    ' Author: Jack
    ' Date: 16-Oct-21
    ' ----------------------------------------------------------------
    Function ssccChk(sampleCode As String) As Integer
              Dim totalSum As Integer
              Dim evenPosSum As Integer  'sum even position values
              Dim oddPosSum As Integer   'sum odd position values * 3
              Dim i As Integer
    10        For i = 1 To Len(sampleCode) - 1 'don't include the check digit in the summation
    20            If i Mod 2 = 0 Then evenPosSum = evenPosSum + CInt(Mid(sampleCode, i, 1))
    30            If i Mod 2 = 1 Then oddPosSum = oddPosSum + CInt(Mid(sampleCode, i, 1)) * 3
    40        Next i
    Calcs:  'The check digit is the number which adds the remainder to 10
    50        totalSum = evenPosSum + (oddPosSum)
    60        Debug.Print "check digit is " & 10 - totalSum Mod 10  'for testing
    
    70        ssccChk = 10 - totalSum Mod 10         
    80        If Right(sampleCode, 1) = ssccChk Then
    90            Debug.Print "valid SSCC"
    100       Else
    110           Debug.Print sampleCode & " Fails the sscc checksum calaulation"
    120       End If
    End Function

    Below is a test routine to do a SSCC code validation/check digit calculation.

    Code:
    Sub testSSCCChk()
     Dim sampleCode As String
             
              'sample sscc code  '007189085627231896
              'from
              'https://www.morovia.com/kb/Serial-Shipping-Container-Code-SSCC18-10601.html
      sampleCode = "007189085627231896"
      Debug.Print "valid check digit is " & ssccChk(sampleCode)
    End Sub
    You can change the check digit and test (to show effect of an invalid check digit).
    example: '007189085627231897 (bad check digit)
    Last edited by orange; 10-16-2021 at 07:13 AM. Reason: spelling

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

Similar Threads

  1. Replies: 19
    Last Post: 06-16-2021, 07:33 AM
  2. Replies: 1
    Last Post: 05-23-2018, 09:35 AM
  3. Advice - getting data filtered to generate report
    By ss188 in forum Database Design
    Replies: 3
    Last Post: 03-24-2017, 08:21 AM
  4. Using totals to generate more data - Need help !
    By anartey in forum Database Design
    Replies: 8
    Last Post: 08-30-2011, 07:29 AM
  5. generate cummulative data
    By charlesdicken in forum Access
    Replies: 1
    Last Post: 01-09-2011, 10:57 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