T
Treebeard
What's the best way to generate barcodes on access reports?
Alek Szymanski said:Treebeard,
There are two basic ways of generating barcodes in Access:
1. Barcode font. The easiest font to use is Code 39. The only
requirement for Code 39 is that you use an asterisk "*" before and
after the data you wish to encode. So, for example, to encode 12345
into a barcode with that value, you can simply type *12345* into the
text box on your report. You also need to make sure the Font property
of the text box is set to the corresponding Code 39 font.
One more thing to keep in mind is that if you wish to encode a space
character, you will need to substitute it with (usually) an underscore
"_".
So, if you wish to encode "123 ABC", you'll have to change it to
"*123_ABC*"
If your barcodes come from a table (the most likely scenario), you can
set up a simple function to encode the data:
Public Function FormatCode39(d As String)
FormatCode39 = "*" & Replace(d, " ", "_") & "*"
End Function
... so in the ControlSource property of the text box, you enter:
=FormatCode39([Barcode])
That's all there is to it.
Of course, if you need fonts other than Code 39, it becomes more
complicated. You may need to calculate the check digit(s) and do
other calculations.
2. The second, and easier way to add barcodes to Access is by using an
ActiveX Control (a plug-in). You simply go to Insert->ActiveX
Control..., and drop the control onto the report or form.
Then, you set the ControlSource of the barcode to the appropriate
field in your database. There is no need to insert start/stop
characters nor any other calculations/substitutions. You can also
choose the symbology, such as Code 39, Code 128, UPC, EAN 128, etc.
Most barcode ActiveX controls support several different symbologies.
With an ActiveX control, you can also control many other properties of
the barcode, such as bar width, height, type of border, color, fonts,
orientation, text position, and more.
If you'd like to try either our Code 39 fonts or the barcode ActiveX
control, please have a look at our download page:
http://www.barcodewiz.com/demo.asp
Both downloads include several examples of use in Access (in reports
as well as forms). Also, the help file includes step-by-step
instructions for setting everything up.
If you have any questions, please don't hesitate to ask.
Alek Szymanski
http://www.barcodewiz.com
"Treebeard" <[email protected]> wrote in messageWhat's the best way to generate barcodes on access reports?