Barcodes may easily be placed on Access forms or reports using the Active-X control of Barcode Macros for Office, Barcode 2D Macros for Office or the Active Barcode Component family of products. (Similar functionality is available for developers through the Active Barcode Components or the dBarcode Developer kits)
Screenshot - click to enlarge
Microsoft Access is a database that holds data in tables. When the Active Barcode Control is added to an Access Form or Report, the control's Properties list allows the user to select one of the Table fields as a Source of the components data - i.e. the data to appear in the barcode. This approach has the advantage that no space is required in the database to store the barcode images - they are created "on the fly" as needed.
An Active Barcode Control may be placed on an Access form or report by selecting the More Controls icon in the toolbox (which, if not visible, can be displayed by checking the Controls Toolbox member of the View – Toolbars menu), or by choosing Active-X Controls from the Insert menu and choosing Active Barcode Control from the list of controls available. In Access 2007/2010 the Active-X Controls item appears on the Design toolbar.
A default barcode image appears on the report. Right-clicking on the barcode and selecting Properties from the pop-up menu causes the control’s Properties dialog to be displayed.
The Record Source may be selected from a drop-down list in the form or report's properties list, and the barcode's Control Source may be selected from the drop down list in the component's properties list. All other properties (code type, size, font, etc.) can be selected from the other entries in the Access Properties list at design time.
This allows barcode creation to be fully automatic for every record in a database.
Of course, a barcode image that is the same on every record may also be created - by ensuring that the Control Source entry on the component's properties list is empty, and the required data is entered for the Caption property.
Barcode macros for Office also includes macros that allow barcode images to be saved within a database table. Sample Access databases for Access 2003 and 2007/2010 are included with the distribution of Barcode Macros for Office
While barcode images are the ideal way to produce barcodes on Access forms or reports, font-based barcodes can be useful in some situation - for example, where Word's Mailmerge is to be used to generate documents containing data from an Access database.
Font-based barcodes are barcodes in the form of a sequence of text characters that appear as a barcode when displayed or printed in a suitable barcode font. The Barcode Macros for Office product provides macros (including source code) for creating font based barcodes from a field in an Access database, storing the resultant barcode text in another field from where it can be used, either to display or print the barcode, or as the source of the barcode for external use - such as Mailmerge in Word.
A developer can modify the macros to create the barcodes without end-user intervention, but two macros are provided - one to allow the user to display a dialog box for setting the required barcode properties, and one to create the barcodes for all records in a table.
Most common 1D barcodes (see list), including many popular postal barcodes, can be stored in a database in this way, and as the barcode text is relatively small the impact on the database size is small. It is important to note that the relevant barcode font needs to be present on the computer that displays or prints the barcode.
Similar functionality for creating 2D barcodes on Access forms and reports is provided by Barcode 2D Macros for Office or the dBarcode 2D Developer Kit - which supports picture barcodes for a wide range of barcode types and font-based barcodes for a limited range of types.