Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 271488 - Last Review: January 29, 2007 - Revision: 3.1
ACC97: How to Format Controls to Properly Display Barcode Fonts
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.
- On the View menu, click Design view.
- Right-click the Code text box, and then click Properties.
- 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). - Click the Data tab, and then change the ControlSource property from Code to:
="*" & [Code] & "*"
NOTE: In your database, the name in brackets should be the name of your data control source, not the word "Code."
- 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.
APPLIES TO
- Microsoft Access 97 Standard Edition
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please