How to Generate Data Matrix Barcodes in Microsoft Access

A comprehensive guide to integrating scannable Data Matrix barcodes into your Microsoft Access reports using VBA modules and Barcodesoft fonts.

1 Adjust Access Macro Security

To enable barcode encoding scripts, you must configure your security settings to allow macros to run within the Access database environment.

For Access 2000 or 2003:

Navigate to Tools > Macro > Security and select Low security level.

data matrix Access Macro Security

For Access 2007 to 2019 / Office 365:

Office 2010 button Office 2016 button Office 2019 button

Click the Office Button/File > Access Options > Trust Center. Under Macro Settings, select "Enable all macros".

data matrix Access Macro Setting

2 Initialize VBA Library References

Open the Visual Basic Editor by pressing ALT + F11.

data matrix Access VBA

Go to Tools > References. Click Browse and navigate to the directory containing cruflbcs.dll.

Typical Path: C:\Program Files (x86)\Common Files\Barcodesoft\Fontutil

Check the box for crUFLBcs 4.0 Type Library and click OK.

data matrix add reference

3 Import the Data Matrix VBA Module

Press Ctrl + M and select barcodesoft.bas from the Barcodesoft folder to import the necessary encoding logic.

If the file is missing, download the module here: Data Matrix VBA Download.

data matrix import vba

4 Create Barcodes in Access Reports

Close the VBA editor and return to Access. Open a report in Design View. In the text box where you wish to display the barcode, enter the following formula in the Control Source:

=datamatrix([TableName].[FieldName])

Replace TableName with your actual table name and FieldName with the data source field.

data matrix barcode excel macro

5 Apply the Barcode Font

Right-click the text box field and select Properties. Under the Format tab, set the Font Name to BcsDatamatrix.

data matrix access font typeface

Ensure the field size is large enough to contain the 2D grid of the Data Matrix barcode.