Generate Code 39 Barcodes in MS Access

Professional barcode solutions for Windows desktop printers.

code39 barcode download code 39 barcode image code39 barcode software order

Code 39 is one of the most widely used barcode symbologies worldwide. Implementing it is remarkably simple: just wrap your data in asterisks (e.g., *DATA*) and apply the Barcodesoft font. By combining the Barcodesoft Code 39 package with Microsoft® Access®, you can efficiently print professional barcodes directly from your desktop.

1 Install Barcode Fonts

Copy all TrueType fonts (*.ttf) from your package folder into your C:\Windows\Fonts directory.

2 Register DLL Components

Open the DOS prompt. If you are using Windows Vista, 7, 10, or 11, please Run as Administrator.

CD C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil
regsvr32 crUFLbcs.dll
code39 barcode
Registration failed? Use the .NET Framework utility: Regtlibv12 _cruflbcs.tlb

3 Configure Access Security

Ensure macros are enabled to allow the barcode generator to function:

  • Access 2000/2003: Tools > Security > Set to "Enable All Macros".
  • Access 2007+: Click the Office Button code 39 office > Access Options > Trust Center > Macro Settings > "Enable all macros".
code 39 access database

4 Open VBA Editor

Press Alt+F11 to launch the Visual Basic Editor.

code39 barcode

5 Reference the DLL

Go to Tools > References. Click "Browse" and locate cruflbcs.dll (typically in the FontUtil folder mentioned in step 2). Check crUFLBcs 1.0 Type Library and click OK.

code39 bar code

6 Import Barcode Module

Press Ctrl+M and select barcodesoft.bas from your installation folder.

code39 barcode vba

Code Snippet for Code 39 Generation:

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

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

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

7 Create the Access Report

In Report Design view, set the field's Control Source to one of the following macros:

  • =code39([TableName.FieldName])
  • =code39Check([TableName.FieldName])
  • =USSCode39([TableName.FieldName])
code39 barcode macro

8 Final Step: Apply the Font

Right-click the field > Properties. Under the Format tab, set the Font Name to Code39mHr or your preferred Barcodesoft typeface.

code39 barcode font