Microsoft KB Archive/271488

= ACC97: How to Format Controls to Properly Display Barcode Fonts =

Article ID: 271488

Article Last Modified on 1/29/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q271488



Moderate: Requires basic macro, coding, and interoperability skills.



SUMMARY
In a Microsoft Access 97 database, you can display barcodes on forms and reports. You would most commonly use this display functionality on reports, but the formatting instructions are the same for forms, and they depend on how the data was entered and stored in the underlying tables.

In order to properly display barcodes, the table field or the report (or form) control must contain not only the numbers and the dash (Example: 71043-1643), but also asterisks on each side of the number (Example: *71043-1643*). To minimize data storage, you should achieve the formatting for the barcodes in the properties of the control on the report (or form), and not in the underlying table field.



MORE INFORMATION
If your table data does not contain the necessary asterisks, follow these steps to format the properties of the control on the report (or form):   Create the following table:   Table: tblBarCodes -  Field Name: ID   Data Type: AutoNumber

Field Name: Code Data Type: Text  Save the table as tblBarCodes. Open the table in Datasheet view.  Type the following records, and then close the table:   ID    Code 1    71043-1643    2     71043-1655    3     71043-1617    4     71043-1633    5     71043-1634    6     71043-1699                     In the Database window, click the tblBarCodes table, and then on the Insert menu, click AutoReport.</li> On the View menu, click Design view.</li> Right-click the Code text box, and then click Properties.</li> Click the Other tab, and then change the Name property to txtCode.

NOTE: This change is needed because the barcode may not be displayed properly if the name of the control on the report (or form) is the same as the name of the field in the control source (the tblBarCodes table).</li> Click the Data tab, and then change the ControlSource property from Code to:

=&quot;*&quot; & [Code] & &quot;*&quot;

NOTE: In your database, the name in brackets should be the name of your data control source, not the word &quot;Code.&quot;</li> Click the Format tab, and then change the Font property to the name of your barcode font. Preview the report (or form). Note that the barcodes are displayed properly.</li></ol>

Additional query words: inf bar code codes

Keywords: kbhowto KB271488

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.