Native Barcode Generator for MS Access
Product Overview and Compatibility
The Native Barcode Generator is intended for MS Access Developers
that wish to easily integrate barcode capability into their databases
and applications without any external dependencies. This product is
implemented as a single VBA Module with complete source code, which
allows the developer greater flexibility in implementation and design
without any annoying add-in menus or license file requirements. Once
installed in a database, no other components or fonts need to be installed
to create barcodes; it is the complete barcode generator that stays
with the database, even when distributed. End users and non-developers
may wish to use the IDAutomation
Barcode ActiveX Controls instead of this product because ActiveX
Controls are easier to implement in Access.
Compatibility and Requirements
||Access 2000 to Access 2007 and above
||Microsoft Windows 95 to Windows Vista
|Barcode Symbology Compatibility
||Code 128, Code 39, Codabar, GS1-128,
Interleaved 2 of 5, MSI, Postnet, Planet, Intelligent Mail OneCode
Confirm, PDF417 and DataMatrix ECC200. *
|Minimum System Requirements
||500 MHZ Processor, 128MB RAM, 5 MB Available
hard drive space
||Access Developers; End users and non-developers
may wish to use the
Barcode ActiveX Controls
* This package does not support UPCA, UPCE, EAN13 or EAN8 barcodes
because of the required OCR text characters that must appear below this
barcode type. If these barcode symbologies are required, the
Font Advantage Package is available as a separate purchase.
Barcode Integration Tutorial
Installing the Access Native Barcode Generator is a simple process.
If problems are encountered with this tutorial, IDAutomation recommends
referring to the sample database included in the package. The demo
version of this product may only be used within the sample database
provided in the
- Extract the files from the Access Native Barcode Generator package.
- Open the database where the barcode is needed.
- Press ALT-F11 to open the Visual Basic Editor. If ALT-F11
does not work, in Access 2000 or 2003 choose Tools - Macro - Visual
Basic Editor. For Access 2007, choose Database Tools - Visual Basic.
- From the Visual Basic Editor, choose File - Import File and
import the appropriate VBA module from the files extracted. To add
support for all linear barcode types, select the
file. VBA modules are not available for importing with the Demo
Version; the demo version may only be used with the sample database
provided. If PDF417 or Data Matrix barcodes are needed, import
the appropriate module from the 2D folder. Once the files are imported,
they become embedded in the database file.
- Choose File - Save and then close the Visual Basic Editor. All
functions of the Access Native Barcode Generator are now embedded
in the database.
- Open the report in Design Mode. This is accomplished by right-clicking
on the report and choosing Design.
- Insert a text box in the details section
of the form, and increase the height and width so it will be able
to contain the barcode. The text box may be easily added by dragging
the field from the Field List. The label on the left side of the
text field may be removed because it will not be visible when the
report runs. Size the box so it is tall and wide enough to contain
the barcode symbol. The height of the barcode is changed by sizing
the text box.
- Right-click on the text box and choose Properties.
Change the Name of the text box to
txtIDAutomationBC1 and verify the control source is the field
that needs to be encoded in the barcode.
Optional: The Control Source may be changed to a formula
that appends text to the data or combines multiple fields,
example: ="PREFIX" & [Field1]
or =[Field1] & [Field2]
or =[Field1] & "," & [Field2]
- Save and run the report. Verify that the data to be encoded
in the barcode appears in the text box. If it does not, consult
Access Help to determine how to get the correct data in the text
box. The result of the Control Source in the text box is what will
be encoded in the barcode. In some cases, it may be necessary to
specify the table and field in the control source, for example:
- If it is desired to have a text interpretation
appear below or above the barcode symbol, copy the text box and
paste it in a suitable location on the form. Save and run the report.
Verify the data that needs to be encoded appears in both text boxes.
- Re-open the report in Design Mode. Right-click on the detail
section of the report, choose Build Event and then choose
- The Visual Basic Editor will appear. Remove any text that appears
in the editor.
- The code builder may insert text automatically, which should
be removed. Copy and paste the following text into the editor so it is the only text appearing:
Option Compare Database
Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Len(txtIDAutomationBC1) > 0 Then
result = IDAutomation_NatG_C128(txtIDAutomationBC1, Me)
result = ""
- If necessary, change the function so that IDAutomation_NatG_C128
is the name of the function used
to create the barcode and txtIDAutomationBC1 is the name
of the text field that is to be encoded as a barcode.
- To create the barcode with default options,
skip this step. To modify
parameters of the barcode such as the X dimension in MILS, place
a comma after "Me" to view available
options. To gain greater control over the size of the barcodes,
or to create very small symbols, the DPI must be changed to 600
- Save and run the report to verify barcodes are being properly
created. If a scanner is needed to verify barcodes, IDAutomation
offers several affordable,
easy-to-use scanner kits. If the barcode does not appear,
check the security settings, double check
all steps of this process and refer to
Technical Support. To adjust the
width of the barcode symbol, change the MILS
setting accordingly. The height of the symbol in linear barcodes
is determined by the size of the associated text box.
Legal Notice: Reports containing this object may only be distributed
outside the licensed organization with the purchase of a Developer License
to the Native Barcode Generator.
(UCC/EAN-128) Symbols in Access
- IDAutomation includes the capability in this product
to create barcodes and text for
GS1-128 (UCC/EAN128) symbols with the
Apply Tilde feature. The following describes the changes
in the Code and the Control Source selections of the
Tutorial to implement GS1-128. The GS1-128 symbol is
created from 17 digits of numbers in the
- Change the
ApplyTilde option in Step 15
to "True." The result
line should be similar to the following:
= IDAutomation_NatG_C128(txtIDAutomationBC1, Me, 12,
- The Control Source selection in
Step 8 may be changed to a formula that encodes
GS1-128 barcodes, for example:
="Ê" & [GS1DataField] &
- The IDAutomation_C128HR function may be used as
the control source for the text interpretation in
Step 10 to place the parenthesis
in the correct locations of the text. For example:
& [GS1DataField] & "~m17" )
Barcode Symbols on one Report
- IDAutomation includes the capability to create multiple
barcode symbols in the same report. The following describes
the changes in the Code and the Control Source selections
of the Barcode Integration
Tutorial to allow multiple symbols to be created:
- Add a text box for each barcode needed in the report,
described in Steps 7 through 10.
- Give each text box a unique name instead of the
standard name recommended in Step 8.
For example, use txtIDAutomationBC1
for the first barcode and
for the second.
- Add additional result lines for each unique
text box name that is to contain a barcode, described
in Step 13. For example:
Private Sub Detail_Print(Cancel
As Integer, PrintCount As Integer)
result = IDAutomation_NatG_C128(txtIDAutomationBC1,
result = IDAutomation_NatG_C128(txtIDAutomationBC2,
Functions of the Access Native Barcode
The result line in Step 13 of this tutorial
may be changed to create various different barcode types, which are
abbreviated below. For example, to create a Code 39 barcode, the result
line on step 13 may look similar to: result =
IDAutomation_NatG_C39(txtIDAutomationBC1, Me) .
The following functions are available:
Barcode Functions (used in the result line
of Step 13)
** (aka: USPS Intelligent-Mail)
|* Available only in 2D versions.
** The OneCode function also supports USPS
IntelligentMail. USPS IntelligentMail and OneCode support
require the installation of the IDAutomationNativeFontEncoder.dll
file, which may be downloaded from
The file is free to use, provided You or Your organization
have purchased a valid License for the Native Barcode
Generator for Access.
Text Functions (used in the text interpretation
of Step 10)
- MILS - The X dimension, which
is measured in 1/1000 of an inch, where 12 is the default.
This value changes the width of the barcode symbol.
- DPI - The dots-per-inch the
graphic is generated for, where 300 is the default. When
using a printer with lower or higher resolution, this value
may be changed to create a more accurate symbol. An accurate
symbol can only be created on a 203 DPI printer when this
value is set to 203.
- DataToEncode - This
string value represents the data being encoded.
- N_Dimension - Determines
the width of the wide bars, which is a multiple of the
X dimension. Valid values are 2 and 3. The default is
- Orientation - Values
of 0, 90 and 270 degrees are supported.
- The name of the report where the barcode is to appear.
This should usually be set to "Me," which is the current
- The name of the text control as defined in
- A Boolean value that determines whether a check digit
should be automatically calculated and included for the
- EncodingMode - The
encoding mode for the Data Matrix symbology; valid values
are 0 for BASE256 (Default), 1 for C40,
2 for TEXT and 3 for ASCII.
- PreferredFormat -
preferred format of the generated DataMatrix barcode.
- ECCLevel - The Reed Solomon
error correction level to be used in PDF417.
- Column and Row Specify
- The number of
rows and columns may be selected, allowing the symbol
to be created in various forms. The PDF417 barcode symbol
is limited to 30 columns and 90 rows. Some scanners and
decoders cannot dependably read symbols with over 20 columns.
- Truncate - By selecting
this option, the right hand side of the symbol is removed
or "truncated." This option should be used primarily in
a clean environment, since it is more susceptible to damage.
- ForceBinary - Forces
the PDF417 barcode to be encoded in Binary mode.
Technical Support & Troubleshooting
Common Problems and Solutions:
Barcodes do not Appear in the Report - Change
- A security setting may be the cause. Security may need
to be changed to allow VBA macros to run.
- To enable
macros to run in Access 2000 & 2003: Choose Tools
- Macro - Security.
Change the security level to
Medium or Low.
Close the database and re-open it.
Macros should now be enabled.
- To enable
macros to run in Access 2007: Open "Customize
Quick Access Toolbar" menu to the right of the office
Select "More Commands."
Choose the "Trust
Center" menu button on sidebar.
Choose the "Trust
Center Settings" button on main pane.
"Macro Settings" menu button on sidebar.
"Enable all macros."
Choose "OK" to close Trust Center.
Choose "OK" to close Access Options.
Close the database
and re-open it. Macros should now be enabled.
Barcode is Truncated:
- Size or move the text box object as described in
Step 7 above.
Barcodes do not Scan with Default Settings:
- Check to make sure that barcode type is enabled in the
scanner and that there is sufficient white space surrounding
the barcode. Additional solutions for this issue are provided
will not scan KB article.
Access Reports run Slow:
- Encoding a large amount of data with PDF417 or Data
Matrix may cause reports to slow down because of the complex
calculations that must be performed in VBA code for the
generation of these symbols. If this issue is observed,
consider decreasing the amount of data being encoded, or
Barcode ActiveX Controls, which are compiled in C++
for improved calculation speed.
Scanning Problems with Small Barcode Sizes:
- Verify a printer of 300 DPI or greater is being used.
An X dimension of 12 MILS or greater should be used with
low resolution thermal 203 DPI printers. IDAutomation also
offers many barcode fonts that
print well to low resolution thermal printers. Additionally,
verify the scanner being used is able to read small barcodes.
Other Barcode Software
IDAutomation offers many other barcode products including:
Additional problems and solutions are provided at IDAutomation
barcode font troubleshooting page and by searching resolved
phone, email and forum support are provided up to 30 days after
phone, email and forum support may be obtained if the
and Upgrade Subscription is active.
Back to Top