Edit a form

In Lotus Domino Designer, open or select your database.

When the database is open, to view a list of forms in the database, click Forms. The default database form is called Document, to edit it, double-click the Document.

Place the cursor in your form, move to position to insert the bar code.

Adding a shared field to a form, to stores a bar code string

Select menu Create | Insert Shared Field... and select;


Using the Script Library in your code

You can use any of the functions in applications you develop using Lotus Notes Designer. To allow a form access to any bar code functions;

- Expand your form by clicking Form name (Form) in your database.

- Select menu View | Programmer's Pane.

- Under your form select the Options section.


Enter Lotus Script code;

Use "ciaxcom"
Using the Querysave event 

Select event Querysave and this Lotus Script code will appear;

Sub Querysave(Source As Notesuidocument, Continue As Variant)

End Sub

Example: If we must print the date as an EAN-128 bar code, we use this function;

CIA_EAN128(  )

Before we use any bar code function, we must first put our data in the correct format.

This code formats the date as yyyymmdd so that 01/01/2002 becomes 20020101. This format is more suitable for use in bar codes.

MyData = Format ( Date, "yyyymmdd" )

Now variable MyData stores the formatted Date. Variable MyBarcode stores the calculated bar code. The bar code is then stored in a field called Barcode.

MyData = Format ( Date, "yyyymmdd" )
MyBarcode = CIA_EAN128 ( MyData )
Source.FieldSetText "Barcode", MyBarcode

The same code can be simplified, without the use of variables;

Source.FieldSetText "Barcode", CIA_EAN128 ( Format ( Date, "yyyymmdd" ) )

This code can be used in a Querysave procedure of a form. When the form is saved the Barcode field is automatically updated with the correct bar code;

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Source.FieldSetText "Barcode", CIA_EAN128 ( Format ( Date, "yyyymmdd" ) )

End Sub

Close the form.

Note: There is a function to create each type of bar code. For example, to create EAN-128 bar codes we use function CIA_EAN128(), to create Code 39 bar code we use function CIA_CODE39().

See: Bar code functions.

Each function requires only a string argument;


the string can be; a fixed string, a variable string, a field or any expression that evaluates to a string.

CIA_EAN128( Date )

The result of the function is a string. The result string contains the bar code characters. The result string can be stored in a string variable or a text field.

After the bar code is calculated using a function, the bar code string can be printed using the correct bar code font. For each type of bar code there is a special bar code font.

Note: For each bar code function, there is a font and font size to use. 

See: Bar code font name and font size to use to discover the font and font size to select.

Selecting the correct bar code font to display / print the bar code

Now the field is in the form, right-click the Barcode field, then select Text Properties... and click Paragraph Hide When tab. Use these settings;

[ ] Previewed for reading
[ ] Opened for reading
[ ] Printed
[ ] Previewed for editing
[ ] Opened for editing

Click Font tab. Use these settings;

Font CIA Code 128 Normal
Size 14
Style Plain


Copyright 2000 CIA (BAR CODES) UK. All rights reserved. Reproduction prohibited.