Checking many types EAN codes (barcodes) and print on one label. Follow

Tomáš Rumíšek

For the store, I need to print labels with the current prices on the goods. I need to print the EAN code in one, the same place on the label. The goods are different and contain different types of EAN codes (UPC-A, EAN 8, EAN 13). EAN codes are stored in 1 column in the XLSX table, which serves as a database for printing (other fields are the product name, code, etc.). I don't know how easiest to do this (a) with a script (b) without a script. I assume that we will have many users with such a query. Thank you for your help. I am using BarTender Designer 2021 R1 Editional Professional.


Pete Thane
Comment actions Permalink

As all these barcodes need data of specific lengths you can use this to determine the barcode image to populate and print.


  • Add onto the label an EAN13,EAN8 and UPCA barcode and link these to the appropriate field in your database. At the moment make it so you can easily select each barcode in turn but later these can be placed on top of one another on the label as at print time only one symbol will print 
  • Add a text filed to the side of the label so it is not in the printable area. Go into the Properties of this field and click on the Change Data Source Name button to the right of the (currently) blank Name box. Give this label a field a name and click close. I called mine CodeLenCheck
  • Now adjust this field so that the Type is Visual Basic Script and the Script Type is Event Controlled Script then press the Edit with.... button
  • The central box should say Value = "Sample Text", click in the box and edit this to say Value = "13" 
  • In the column on the left scroll down a short way and highlight the OnNewRecord event and the script box in the middle will now be blank.
  • Click into this box and type the following Value = 
  • In the right hand column scroll down and double click on the database field that contains your barcode numbers to link this field to the script
  • Press enter and add a second line of code as follows: Value = Len(Value) 
  • (This VB will look at the barcode data, count the number of characters and report back the LENgth of the string)

  • Click close and Close again to come out of the text field and in turn adjust each barcode to be supressed unless the length of the data matches the barcode type.
  • To do this for the EAN13 for example, go into the Properties of the code and click on the Transforms tab and Suppression.
  • Choose the Suppress when the following...... option and click the + symbol next to the Add
  • A new line will now appear, click on the blue part and amend this to the named data source configured above then adjust the green part Does Not Equal and in the final box type 13. and so your screen should look like this


  • Click OK and close and wow repeat this suppression process for the UPCA (not equal 12) and the EAN8 (not equal 8)
  • Drag the 3 barcodes on top of one another and then you are done.


I hope this helps

Please sign in to leave a comment.