Tip, April 2003

Using and Creating Barcodes with DB/TextWorks® or CS/TextWorks

Using barcodes in conjunction with DB/TextWorks or CS/TextWorks databases can be a very sensible choice. Barcodes have the capacity to speed up operations and eliminate human error. Barcodes are widely used by libraries that carry out their library management functions by means of DB/TextWorks or CS/TextWorks and one of the library packages that Maxus can supply – Inmagic Genie or Maxus Library. They can also be helpful in a variety of contexts beyond libraries. This tip sheet explains what barcodes are, how they work in a DB/Text context, and how you can use them.

What is a barcode?

Perhaps the best definition of a barcode comes from the "ISSN and barcoding" web page:

A barcode is the optical translation, in the form of alternating vertical bars and spaces, of a numeric or alphanumeric code which allows the identification of an entity.

In other words, a barcode is nothing more complicated than a sequence of bars and spaces that represent an underlying string of letters and numbers. A barcode is created by using a font that changes the underlying string into the bars and spaces.

Barcode readers come in various shapes and sizes, depending on your needs and budget. What barcode readers have in common is that they are able to convert the symbols on a barcode into the underlying numbers and letters. They are independent of software – for example, if you take a barcode wand and read a barcode into your computer, the same string of characters will be read onto your screen, regardless of whether you are in DB/TextWorks, Microsoft Word for Windows, a text editor, or any number of other packages.

Barcode applications in DB/TextWorks or CS/TextWorks

Barcodes can be very useful in Textworks. Typically, they can be used for managing loans activities in a library situation, but of course they are suitable for a variety of other applications – for instance, asset tracking or records management. The point is that any TextWorks record that contains a unique string is amenable to barcoding. In a loans situation, this means a unique entry to identify a borrower and a unique entry to identify a library item such as a book or a bound volume of a journal. Note that the unique field does not even need to contain numerical characters only – barcodes can just as easily translate letters or a mixture of letters or numbers. (Note, however, that barcode labels can become very large if many letters are used in the string.)

How to use barcode strings in TextWorks records

There are two distinct ways of handling barcodes in TextWorks: (a) create or purchase barcode labels and "read" a label into each TextWorks record; or (b) create unique strings in each record and then use the TextWorks form designer in conjunction with a barcode font to print your own barcode labels.

1. Reading label strings into TextWorks

Many users start with pre-printed sheets of barcode labels. You can purchase these from a supplier (Maxus can do this for you), or you can generate them yourself using a program like Label+. If you have DB/TextWorks version 6 or later, you can also download the barcode generation utility that came with version 6.0 and use this to create your own labels.

Once you have some pre-printed barcode labels, all you need to do is set up your textbase with a unique record identification field. Define the field as a Number field if your barcode labels contain numbers only, or text if they context either text only or a mixture of text and numbers. Also be sure to define the field as "Unique Entries Only" in the validation area of the Textworks Edit Fields dialog.

As you create each new record (for example, a new catalogue record in a library or a new asset record in an asset tracking system), simply stick the next available barcode label on the item for which you are creating a record, position your cursor in the box corresponding to the unique record identifier field and wand in the string on the label. You now have a record that can be identified by a unique string. To retrieve this record from now on, you can of course type that string into a query screen but it is much quicker and much more accurate to place your cursor in the relevant box in a query screen and enter the string by scanning the barcode with a wand or reader.

NOTE: Many barcode readers, including those supplied by Maxus, can be programmed to insert a final character. In many cases, users choose to have their readers insert a final Carriage Return (or Enter key) after they read in the barcode string. This makes for faster processing in those instances where you would otherwise need to type an Enter key to force Textworks to run a search, for example. If your reader does insert an Enter key as a matter of course, you will need to delete that Enter key (by using your Back Space key) if you are simply reading barcode numbers into a new record.

2. Getting label strings out of TextWorks

Alternatively, you can set up your textbase with a unique record identifier field defined as either an Automatic Number (if you want numbers such as 1020123, 1020124, 1020125, ...) or an Automatic ID (if you want strings like P1023, P1024, ...). Once you have created a number of records, you can print some barcode labels using a barcode font. The font that Inmagic, Inc., recommended for use with of DB/TextWorks or CS/TextWorks is a font called "Free 3 of 9". It can be downloaded without cost from the Barcodes, Inc. web site.

To print barcode labels, you will need to design a TextWorks form that uses the barcode font. What follows below are instructions for designing such a form. The form in question is based on the Avery 5160 label and contains three pieces of information: the barcode symbols, the barcode string in "normal" characters, and the name of the organisation to whom the labels belong.


  • Open the relevant textbase in TextWorks.
  • Click on Display>Design Form>New Label Form>Avery 5160 (or whichever label form is most appropriate to the type of label that you want to create) then OK.
  • TextWorks will now present you with a Form Designer window that includes an oblong area corresponding to the size and shape of the label type that you just selected.
  • Now, add into this form the fields that you want to include on the barcode label. For example:
    • Edit>Add>Form Box, then position your cursor over the name of the field that contains the unique record identifier (e.g. "ID"), then click Add.
    • Next: Edit>Add>Form Box, position your cursor over the ID field again and click on Add.
  • Now click into the Format tab and the Added Text sub-tab, and add an asterisk (*) as the Beginning Text and as the Ending Text. (You need to include an asterisk both before and after the barcode string if you are using the "Free 3 of 9" font.)
  • Then click into the Format tab and the Font, Color sub-tab and change the font to your barcode font by clicking on the Set Font button and selecting "Free 3 of 9" or whichever barcode font you have downloaded to your machine. Then click OK and Apply. If you wish, you can also use the Set Font facility to change the size of the barcode symbols.
  • You might also like to add your organisation's name or your library's name. To do this, click on Edit>Add>Text Box and type in the relevant name then Apply and Close.
  • Save the form, giving it a useful name – for example, Print>Barcode Labels – and making it a Public form for use in the Report Window and in Report Printing.

When you print labels using this form, they will look something like this:

You can now stick these labels onto the items to which they correspond, which will enable you to retrieve them in your TextWorks textbase at any time by means of a quick scan with your barcode wand or reader.



Maxus can supply you with a range of barcode readers and labels. For more information please see our barcodes page. You might also like to read our tip on Stocktaking.



Maxus Australia Pty Ltd - Contact us for any further information or other hints.