Creating Custom Check Digits

Create a custom check digit with VB Script by using an existing check digit algorithm or by creating a custom algorithm.

To create a Custom Check Digit with VB Script using an existing algorithm

  1. Double-click the desired barcode to open the Barcode Properties dialog.

  2. In the Navigation Bar, select the data source containing the data to encode.

  3. On the Data Source tab of the Data Source property page, select the icon next to Name to open the Change Data Source Name Wizard.

  4. Enter a new name for the data source.

  5. Click OK to close the Change Data Source Name Wizard.

  6. Select the icon, located on the data source toolbar to launch the New Data Source Wizard.

  7. For the Type, select Visual Basic Script.

  8. Click Finish to close the New Data Source Wizard.

  9. Keeping the Script Type as Single-Line Expression, select Edit next to Script Type to open the Script Assistant.

  10. Remove any existing expression text from the Expression field.

  11. Under Category, expand the Functions category.

  12. Under Category, select Check Digit from the expanded list of available functions.

  13. Under Name, double-click the desired check digit type.

  14. In the Expression field, replace the highlighted text («String») with the share name of the data source named in Step 4, above.

  15. Click OK to close the Script Assistant.

To create a Custom Check Digit with VB Script using an custom algorithm

  1. Double-click the desired barcode to open the Barcode Properties dialog.

  2. In the Navigation Bar, select the data source containing the data to encode.

  3. On the Data Source tab of the Data Source property page, select the icon next to Name to open the Change Data Source Name Wizard.

  4. Enter a new name for the data source.

  5. Click OK to close the Change Data Source Name Wizard.

  6. Select the icon, located on the data source toolbar to launch the New Data Source Wizard.

  7. For the Type, select Visual Basic Script.

  8. Click Finish to close the New Data Source Wizard.

  9. Change the Script Type to Multi-Line Script.

  10. Select Edit next to Script Type to open the Script Assistant.

  11. Remove any existing script text from the Script field.

  12. Enter a custom check digit calculation algorithm, similar to the following:

    'Create a Mod43 check digit

    charSet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-.$/+%"

    For i + 1 ToLen(C39)

    total = InStr(charSet, Mid(C39,i,1)) - 1 + total

    Next

    Value = Mid(charSet, (total Mod 43 + 1), 1)

  13. Click OK to close the Script Assistant.

Related Topics