QR Code Barcodes in MS Access Query
Easily create QR 2D Barcodes in Access Query
- This tutorial shows how to encode the barcode value directly in a SQL query.
- The query is based on a data table. It has all the same fields as the table, plus one barcode field.
- The benefit of this method is the query can be used as a data source for an Access Report, Form, or even other programs like MS Word or Publisher.
- Any software which imports from an Access database can create QR barcodes.
- Watch the video, or simply follow the steps below.
![](https://media.barcodewiz.com/images/49caeeda-d3ee-480e-ba5e-9d996c01ea11-QR-ACCESS-QUERY-Thumb.png)
Step 1. Import module with barcode functions
- Click on Database Tools tab > Visual Basic (or press Alt + F11).
![](https://media.barcodewiz.com/images/cfe6d8eb-0fd2-4a8b-8d77-148a33121adc-qr-access1.png)
- Right-click the database and Import File....
![](https://media.barcodewiz.com/images/73448bd6-f7d2-4611-a9ed-393403304515-qr-access2.png)
- Select BarCodeWizQrCode.bas
- The default location of the file is:
Program Files\BarCodeWiz\BarCodeWiz QR Code Fonts\BarCodeWizQrCode.bas
![](https://media.barcodewiz.com/images/801584a1-5c8d-4885-908b-3b1be6fab5d7-qr-access4.png)
- The following module should now be part of the Access file.
![](https://media.barcodewiz.com/images/f60b2cea-af6a-48d4-ab9e-74117673ab42-qr-access5.png)
Step 2. Create a new table (or use an existing table)
- Create a new table or use an existing table. Our table has the following data:
- item_barcode is a Text field containing the barcode data we will encode.
- item_name is a Text field with item description
item_price is a Number field with the item's price
![](https://media.barcodewiz.com/images/4af8a5bb-3204-4c7a-ab54-67121891fef2-qr-access6.png)
Step 3. Create a new Query
- Click on Create tab > Query Design
![](https://media.barcodewiz.com/images/dd103b6b-829f-4e8d-bc0d-b5361811f84d-qr-access12.png)
Step 4. Add our table to the query
- Click on Query Design and select Add Tables
![](https://media.barcodewiz.com/images/9a204713-2095-47c8-911d-926bc331cebf-qr-access7.png)
- Double-click on Items in the Add Table dialog, and click Close.
![](https://media.barcodewiz.com/images/1d28096d-9fea-4a1f-8090-2a2a10bf37d7-qr-access13.png)
Step 5. Edit Query
- Add all items in the first column: Items.*
- Add a new calculated field to show the encoded barcode:
MyBarcode: QrCodeEncode([item_sku])
![](https://media.barcodewiz.com/images/18f6212b-f6d6-400d-8080-d2231e1db0f9-qr-access8.png)
- Right - click on Query; select Save to update your query, and
- select Datasheet View
![](https://media.barcodewiz.com/images/57bbd1e9-8dae-4159-b45d-987c93362bad-qr-access9.png)
- The field MyBarcode contains the encoded value of item_barcode. The function QrCodeEncode() encodes the text into QR Code barcode.
- This query may be used anywhere you'd normally use the Items table.
- To display it as a barcode, simply change the Font Name and Size in the Report.
![](https://media.barcodewiz.com/images/5ad64eb8-b0c1-454a-82de-6942d122890b-qr-access10.png)
EXAMPLE: Using the query as a data source for a Report
- Create a new report: Create > Report Wizard
![](https://media.barcodewiz.com/images/a17b3019-43e2-42a0-97af-80f06682daa0-qr-access11.png)
- Select the Query1 as the source and select all fields.
- Click Finish and edit the report in Design Mode.
![](https://media.barcodewiz.com/images/17993d20-7131-4c7e-ac4e-45153dd586a6-qr-access14.png)
- Switch your report to Design View, by right-clicking it and selecting "Design View".
- Edit the text box (right - click on the text box and select: "Properties") to change the Font Name and Size:
Font Name: BCW_QR
Font Size: 10 - Set "Can grow" to Yes.
- It may be necessary to make the column with barcode a bit wider.
NOTE: For smaller barcodes, you can set the point size as low as 2pt
![](https://media.barcodewiz.com/images/f53d5878-8f46-4073-b8ab-dd0b2b0ac1d6-qr-access15.png)
Finished
- Print Preview of the report.
![](https://media.barcodewiz.com/images/5b58c166-acd3-4329-a260-8d7446f0a962-qr-access16.png)