Home Products Support Blog Contact

Generate Code 128 barcodes in MS Access, MS Excel, and Crystal Reports

Keywords: code 128 barcode, GS1128, UCC/EAN-128, ISO/IEC 15417:2007

ISO/IEC 15417 standard specifies Code128. Code128 barcode can encode alpha-numeric data or numbers.

Code128 has three subsets: code128A, code128B, and code128C.

Code128A is used to encode uppercase alpha and control characters.

Code128B is used to encode both uppercase and lowercase alpha and numeric data.

Code128C is used to encode numeric-only data. USS Code128 uses subset C.

As mentioned in Wikipedia, this is the mapping table of Barcodesoft Code128 Barcode Font

Code128 Set A Code128 Set B Code128 Set C Mapping Code128 Set A Code128 Set B Code128 Set C Mapping
Space Space 00 236 (0xFC) V V 54 V
! ! 01 ! W W 55 W
" " 02 " X X 56 X
# # 03 # Y Y 57 Y
$ $ 04 $ Z Z 58 Z
% % 05 % [ [ 59 [
& & 06 & \ \ 60 \
' ' 07 ' ] ] 61 ]
( ( 08 ( ^ ^ 62 ^
) ) 09 ) _ _ 63 _
* * 10 * NUL ` 64 `
+ + 11 + SOH a 65 a
, , 12 , STX b 66 b
- - 13 - ETX c 67 c
. . 14 . EOT d 68 d
/ / 15 / ENQ e 69 e
0 0 16 0 ACK f 70 f
1 1 17 1 BEL g 71 g
2 2 18 2 BS h 72 h
3 3 19 3 HT i 73 i
4 4 20 4 LT j 74 j
5 5 21 5 VT k 75 k
6 6 22 6 FF l 76 l
7 7 23 7 CR m 77 m
8 8 24 8 SO n 78 n
9 9 25 9 SI o 79 o
: : 26 : DLE p 80 p
; ; 27 ; DC1 q 81 q
< < 28 < DC2 r 82 r
= = 29 = DC3 s 83 s
> > 30 > DC4 t 84 t
? ? 31 ? NAK u 85 u
@ @ 32 @ SYN v 86 v
A A 33 A ETB w 87 w
B B 34 B CAN x 88 x
C C 35 C EM y 89 y
D D 36 D SUB z 90 z
E E 37 E ESC { 91 {
F F 38 F FS | 92 |
G G 39 G GS } 93 }
H H 40 H RS ~ 94 ~
I I 41 I US DEL 95 à (0xF0)
J J 42 J FNC3 FNC3 96 á (0xF1)
K K 43 K FNC2 FNC2 97 â (0xF2)
L L 44 L Shift Shift 98 ã (0xF3)
M M 45 M Code C Code C 99 ä (0xF4)
N N 46 N Code B FNC4 Code B å (0xF5)
O O 47 O FNC4 Code A Code A æ (0xF6)
P P 48 P FNC1 FNC1 FNC1 ç (0xF7)
Q Q 49 Q Start A Start A Start A è (0xF8)
R R "50" R Start B Start B Start B é (0xF9)
S S 51 S Start C Start C Start C ê (0xFA)
T T 52 T Stop Stop Stop ë (0xFB)
U U 53 U
Code128 has many variations, such as EAN128, ISBT128, and GS1128. Since 2004, use of GS1128 symbology has become mandatory for printing labels of Confirmation Services.

Code128 barcode is able to encode the entire ASCII table. With Barcodesoft Keyboard Wedge Emulation program and a USB scanner, you can emulate any special character input into your system.

A check digit is always required by Code128. When you use Barcodesoft Code128 font to print bar code, please use our Encoder to calculate checksum for you. You can also find checksum calculation source code in VBA and C language.

There are 28 code128 barcode fonts in the package, as listed below. Each font shows an aspect ratio by its name. Those code128 fonts with "Hr" in their names have human readable text underneath barcode.

For example, Code128AmHr means ‘medium aspect ratio’, with human readable.

Code128XXL means ‘XXL aspect ratio’, without human readable.

Barcodesoft Code128 Demo has "Demo" watermark.

Barcodesoft Code128 barcode fonts are available in true type, PostScript, PCL, SVG, Open Type (eot), and Web Open Font Format (woff / woff2). Users can embed Code128 fonts into Adobe PDF files.

Here is the list of Barcodesoft Code128 Barcode Fonts
Aspect Ratio No Human Readable Set A with HR Set B with HR Set C with HR
XXS Code128XXSHr Code128AXXS Code128BXXS Code128CXXS
XS Code128XSHr Code128AXS Code128BXS Code128CXS
S Code128SHr Code128AS Code128BS Code128CS
M Code128MHr Code128AM Code128BM Code128CM
L Code128LHr Code128AL Code128BL Code128CL
XL Code128XLHr Code128AXL Code128BXL Code128CXL
XXL Code128XXLHr Code128AXXL Code128BXXL Code128CXXL

This is the pricing list of Barcodesoft Code128 package
License Single User 5-User 10-User Site Corporate Developer 5-Developer 10-Developer Unlimited Developer
Price CAD299 CAD399 CAD599 CAD799 CAD999 CAD1199 CAD1399 CAD1999 CAD2999

Integrate Code128 Barcode With Crystal Reports

1. Right click command prompt and run command prompt as administrator.




Type in the following commands to register cruflbcs.dll
cd "C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil"
regsvr32.exe cruflbcs.dll



To register 64-bit DLL, please type in the following commands
cd "C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil"
%systemroot%\System32\regsvr32.exe cruflbcs_x64.dll



If you see the following Window pop up, your registration was successful.




2. Open your crystal report. Right click Formula Fields, choose "New..." from the context menu. Type in "code128" in the Name textbox, then click "Use Editor".



3. Double click "BCSLinearcode128" function from Visual Basic UFLs list as shown.


4. Then type in the database field as parameter for code128 formula. And click "Save" button to save code128 formula field.


5. Drag and drop the code128 formula field in your crystal report design view.



6. Right click code128 formula field and choose "Format Field" from context menu. Then choose "code128mHr" font typeface.



Click OK Button. You will see code128 barcode in your crystal report.



Integrate Code128 Barcode With MS Excel

1. Right click command prompt and run command prompt as administrator.




Type in the following commands to register cruflbcs.dll
cd "C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil"
regsvr32.exe cruflbcs.dll



To register 64-bit DLL, please type in the following commands
cd "C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil"
%systemroot%\System32\regsvr32.exe cruflbcs_x64.dll



If you see the following Window pop up, your registration was successful.




2. Start Microsoft® Excel® first.


If you are using Excel 2000 or 2003, click menu ===> Tools ==> Macro ===> Security. Choose Low security level.



If you are using Excel 2007 / 2010 / 2013 / 2016 / 2019, click the Microsoft Office Button.

Then click Excel Options, choose Trust Center. In the Macro Settings category, under Macro Settings, choose "Enable all macros" as shown below.



3. Press ALT + F11 to open Microsoft® Visual Basic editor.


4. From Visual Basic editor, choose menu Tools ===> References. It will popup a dialog. Click Browse button and choose cruflbcs.dll from your working folder.
Usually it's under C:\Program File (x86)\CommonFiles\Barcodesoft\Fontutil folder.
Click the checkbox beside crUFLBcs 1.0 Type Library as shown below. Then click OK button.



5. Press Ctrl+M, it will popup a dialog, choose barcodesoft.bas under C:\Program File (x86)\CommonFiles\Barcodesoft\Fontutil folder. Then click "Open".

If you don't find barcodesoft.bas, please download it from Code128.


6. Close Visual Basic editor and go back to your spreadsheet. Now, you can use the following macros to encode data: Code128 . When you have lots of data to process, you can just copy and paste the macro to the whole column and all data will be encoded immediately.
=Code128A(xxx)
=Code128B(xxx)
=Code128C(xxx)

Please use cell reference to replace xxx in the formulas as shown below.



7. Right click Cell B1, choose Format Cell from context menu. Then click Font to apply one of the appropriate font typefaces to the cell, such as Code128mHr.



Integrate Code128 Barcode With MS Access

1. Right click command prompt and run command prompt as administrator.




Type in the following commands to register cruflbcs.dll
cd "C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil"
regsvr32.exe cruflbcs.dll



To register 64-bit DLL, please type in the following commands
cd "C:\Program Files (x86)\Common Files\Barcodesoft\FontUtil"
%systemroot%\System32\regsvr32.exe cruflbcs_x64.dll



If you see the following Window pop up, your registration was successful.




2. Start Microsoft® Access®.

If you are using Access 2000 or 2003, click menu ===> Tools ==> Macro ===> Security. Choose Low security level.


If you are using Access 2007 / 2010 / 2013 / 2016 / 2019, click the Microsoft Office Button.

Then click Access Options, choose Trust Center. In the Macro Settings category, under Macro Settings, choose "Enable all macros" as shown below.



3. Press ALT + F11 to open Microsoft® Visual Basic editor.


4. From Visual Basic editor, choose menu Tools ===> References. It will popup a dialog. Click Browse button and choose cruflbcs.dll from your working folder.
Usually it's under C:\Program File (x86)\CommonFiles\Barcodesoft\Fontutil folder.
Click the checkbox beside crUFLBcs 4.0 Type Library as shown below. Then click OK button.



5. Press Ctrl+M, it will popup a dialog, choose barcodesoft.bas under C:\Program File (x86)\CommonFiles\Barcodesoft\Fontutil folder. Then click "Open".

If you don't find barcodesoft.bas, please download it from code128.


6. Close Visual Basic and go back to your Access database. Now, create a report in Design view and type in one of the following macros in the field where you want to show code128 barcode before apply font typeface, such as Code128mHr:
=Code128A([data.code])
=Code128B([data.code])
=Code128C([data.code])

Please notice that 'data' is the Table name, 'code' is the Field name.



7. Right click the field you want to display code128 barcode. Choose Properties from context menu. Apply one of the appropriate font typefaces to the field, such as code128mHr.