Native Barcode Generator for Microsoft Access
Patent Pending
INDEX:
The Native Barcode Generator is a product intended for 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 much 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
IDAutomation's Barcode ActiveX Controls
instead of this product because ActiveX Controls are easier to implement in Access.
| Compatibility
and Requirements |
| Application Compatibility |
Access 2000 to Access 2007 and above |
| OS Compatibility |
Microsoft Windows 95 to Windows Vista
and above |
| 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 |
| Intended Implementer |
Access Developers;
End users and non-developers may wish to use
IDAutomation's 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
UPC/EAN Barcode Font Advantage
is available as a separate purchase.
Installing the Native Barcode Generator is a fairly easy 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
download.
-
Extract the files from the Native Barcode Generator package.
- Open the database the barcode is needed for.
- 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 IDAutomation_Native_Barcode_VBA.bas
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 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 bar-code.
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,
for example: ="PREFIX" & [Field1] or
=[Field1] & [Field2] or =[Field1] &
"," & [Field2]
- Save and run the report. Verify the data that needs 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:
=([Table1.Field1])
- 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 and choose Build Event and then choose Code Builder.

- 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 green text into the editor
so it is the only text appearing:
Option Compare Database
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
result = IDAutomation_NatG_C128(txtIDAutomationBC1, Me)
End Sub
- 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 or greater.

- 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: Technology used in this product is Patent Pending. Reports
containing this object may only be distributed outside the licensed organization
with the purchase of a Developer License to the Native Barcode Generator.
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 Barcode Integration Tutorial to
implement GS1-128. The GS1-128 symbol is created from 17 digits of numbers in the
GS1DataField field.
- Change the ApplyTilde option in
Step 15 to "True". The result
line should be similar to the following:
result = IDAutomation_NatG_C128(txtIDAutomationBC1,
Me, 12, True)
- The Control Source selection in Step 8 may be changed
to a formula that encodes
GS1-128
barcodes, for example: ="Ê" & [GS1DataField] & "~m17"
- 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: =IDAutomation_C128HR
("Ê" & [GS1DataField] & "~m17" )
IDAutomation includes the capability to create multiple bar-code 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 txtIDAutomationBC2 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, Me)
result = IDAutomation_NatG_C128(txtIDAutomationBC2, Me)
End Sub
The result line in Step 13 of the 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 like: result = IDAutomation_NatG_C39(txtIDAutomationBC1,
Me) .
The following functions are available:
| Barcode Functions
(used in the result line of Step 13) |
| IDAutomation_NatG_C128 (TextControlName,
ReportControlName,
Mils, ApplyTilde,
DPI, Orientation) |
| IDAutomation_NatG_C128A(TextControlName,
ReportControlName,
Mils, DPI,
Orientation) |
| IDAutomation_NatG_C128B(TextControlName,
ReportControlName,
Mils, DPI,
Orientation) |
| IDAutomation_NatG_C128C(TextControlName,
ReportControlName,
Mils, DPI,
Orientation) |
| IDAutomation_NatG_C39(TextControlName,
ReportControlName,
Mils, N_Dimension,
IncludeCheckDigit,
DPI, Orientation) |
| IDAutomation_NatG_Codabar(TextControlName,
ReportControlName,
Mils, N_Dimension,
StartChar, StopChar, DPI,
Orientation) |
| IDAutomation_NatG_DataMatrix(TextControlName,
ReportControlName,
Mils, ApplyTilde,
EncodingMode,
PreferredFormat, DPI,
Orientation) * |
| IDAutomation_NatG_I2of5(TextControlName,
ReportControlName,
Mils, N_Dimension,
IncludeCheckDigit,
DPI, Orientation) |
| IDAutomation_NatG_MSI(TextControlName,
ReportControlName,
Mils, N_Dimension,
IncludeCheckDigit,
DPI, Orientation) |
| IDAutomation_NatG_OneCode(TextControlName,
ReportControlName,
Mils, DPI,
Orientation) ** (aka: USPS IntelligentMail) |
| IDAutomation_NatG_PDF417(TextControlName,
ReportControlName,
Mils, EccLevel,
ColumnSpecify,
RowSpecify,
Truncate, ForceBinary,
DPI, Orientation)
* |
| IDAutomation_NatG_Postnet(TextControlName,
ReportControlName,
Mils, IncludeCheckDigit,
DPI, Orientation) |
| IDAutomation_NatG_Planet(TextControlName,
ReportControlName,
Mils, IncludeCheckDigit,
DPI, Orientation) |
| Text Functions
(used in the text interpretation control source of Step 10) |
| IDAutomation_C128HR (DataToEncode,
ApplyTilde) This function is used
to format text for GS1-128 barcode
types. |
| IDAutomation_SpliceText (DataToEncode,
SpacingNumber, ApplyTilde)
This function is used to separate text digits into even segments to
ease readability. |
| MODU10(DataToEncode)
This function generates a GS1 MOD10 check digit. |
* 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
http://www.idautomation.com/fonts/tools/windows_dll/.
The file is free to use, provided You or Your organization has purchased a valid
License for the Native Barcode Generator for Access.
Description
of the properties of the functions:
- 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 is a string value
that 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 2.
- Orientation - Values of 0, 90 and 270 degrees
are supported.
- ReportControlName - The name of the
report the barcode is to appear on. This should usually be set to "Me", which
is the current report.
- TextControlName - The name of the text
control as defined in Step 8.
- IncludeCheckDigit - A Boolean value
that determines whether a check digit should be automatically calculated and
included for the DataToEncode.
- 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 - The
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
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.
- ApplyTilde - In Code 128 AUTO and UCC128,
if the ApplyTilde option is set to True, the tilde will be processed and allow
the following encoding options:
- ASCII characters: The format ~ddd may be used to specify the
ASCII code of the character to be encoded. For example, if entering the
following text in the Data field: 66~02977
it will actually encode 66GS77 where
GS is a delimiter ASCII 29 character.
Other commonly used ASCII codes are ~009 for a tab and ~013 which is a return
function. To encode other functions, please refer to IDAutomation's
ASCII chart.
- Encode
GS1-128
(UCC/EAN-128): To encode alpha-numeric UCC/EAN128,
the character must be set to "AUTO" for automatic. Then, ASCII 202 or character
Ê is entered as the FNC1 before each AI and the required start C is included
automatically. For example, the GS1 number of (8100)712345(21)12WH5678 should
be entered as: ~2028100712345~2022112WH5678.
In most cases, the AI's will be properly represented in the human readable
text. If the parenthesis are not around the correct number for the AI, enter
the following extended ASCII character as the FNC1 for the correct number
of digits in the AI:
~212 = 2 digits
~213 = 3 digits ~214 = 4 digits
~215 = 5 digits
~216 = 6 digits ~ 217 = 7 digits
For example, to encode (1277)560128, 4 digits, enter
~2141277560128.
For more information, please refer to the
GS1-128
section of IDAutomation's Code 128 FAQ.
- Mod 10 Check digit: To create a Mod 10 check digit for xx number
of characters, add the following to the DataToEncode: ~mnn (where
nn is a 2 digit number representing the number of characters preceding the
tilde in which to base the Mod 10 calculation). The additional MOD 10 check
digit is commonly used in GS1 (UCC/EAN) barcode types. For example, setting
the DataToEncode property to ~2024021234567890123456~m16
will cause a mod 10 check digit to be created based on all 16 characters
before the tilde. The human readable text and scanned data will display
as (402)12345678901234560. The final 0 is the mod 10 check digit and replaces
~m16.
- Encode FNC2: When necessary, the FNC2 character may be inserted
into the DataToEncode string by using ASCII 197. For example;
~1978012349091. IDAutomation's
SC5USB Scanner may be programmed to hold the barcode starting with the
FNC2 in memory and only transmit it to the computer after scanning a barcode
containing the FNC1.
Common Problems and Solutions:
- Barcodes do not Appear in the Report:
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
button.
Select "More Commands."
Choose the "Trust Center" menu button on sidebar.
Choose the "Trust Center Settings" button on main pane.
Choose the "Macro Settings" menu button on sidebar.
Select the "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 in the
Barcode 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 implement
IDAutomation's 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.
- Additional problems and solutions are provided at IDAutomation's
barcode
font troubleshooting site and by searching resolved
public help desk
issues. Priority
phone, email and help desk support is provided up to 30 days after purchase.
Additional priority
phone, email and help desk support may be obtained if the
Priority Support and Upgrade
Subscription is active.
IDAutomation has many other products to offer for barcoding purposes including:
© Copyright 2006-2007 IDAutomation.com, Inc., All Rights Reserved.
Legal Notices.
|
Over 70% of Fortune 100 companies
use IDAutomation's products to automate their businesses.
|