Microsoft Access Code 128 & GS1-128 Barcode Guide

Easily integrate professional barcode printing into your Access databases using Barcodesoft high-density fonts.

Code 128 is a high-density alphanumeric symbology used worldwide for shipping and inventory. Because it requires a mandatory checksum calculation, printing it directly from a font requires a helper function. Barcodesoft provides the perfect font package and VBA tools to make this seamless on any Windows computer.

1

Install TrueType Fonts

Copy all TrueType font files (*.ttf) from your package's fonts folder to C:\Windows\Fonts.

2

Register Encoder DLL

Open the DOS Command Prompt (Run as Administrator in Windows Vista/7/10/11) and navigate to the utility folder:

CD C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil
regsvr32 crUFLbcs.dll
code128 GS1128 barcode

If registration fails, use the .NET Framework utility: Regtlibv12 _cruflbcs.tlb

3

Configure Access Macro Security

Ensure macros are enabled so the barcode functions can run. In Access 2007+, go to Trust Center Settings and set Macro Settings to "Enable all macros".

code128 office code128 access database
4

Add DLL References in VBA

Press Alt+F11 to open the Visual Basic Editor. Go to Tools > References, click Browse, and select cruflbcs.dll from the FontUtil folder.

code128 GS1128 barcode VBA code128 bar code
5

Import VBA Module

Press Ctrl+M and import barcodesoft.bas. Ensure your module contains the following function logic:

code128 barcode VB
Public Function GS1128(ByVal strToEncode As String) As String
    Dim obj As cruflBCS.CLinear
    Set obj = New cruflBCS.CLinear
    GS1128 = obj.UCCEAN128(strToEncode)
    Set obj = Nothing
End Function

Public Function Code128B(strToEncode As String) As String
    Dim obj As cruflBCS.CLinear
    Set obj = New cruflBCS.CLinear
    Code128B = obj.Code128B(strToEncode)
    Set obj = Nothing
End Function
6

Display Barcodes in Reports

  1. Create a report in Design View.
  2. In the field's Control Source, enter the macro (e.g., =Code128B([TableName].[FieldName])).
  3. Right-click the field, choose Properties, and set the Font to an appropriate typeface like code128amHr.
code128 barcode macro code128 barcode font