Using 1 form to filter database & add text field to Label Follow

Alato Di Martino


I have a problem, I will try to explain as short as possible :)

We have Bartender 2016 Automation.

At the moment we have several labels which are printed with Printstation from an access database.

I added a filter in the database to select a product.

If a user wants to print a label with printstation these are the steps.

1. system ask the product (filter) in a separate window

2. if the data (product) exists a form will open with some extra text field to print on the label

3. Then the user press enter on the form and the label of the selected product will be printed together with the additional textfields

Now the question :)

We have a barcode that contains the product and the additional textfield.

is it possible to do the following

1. Scan the data in a textfield

2. extract from this textfield the product (filter) and the addional textfield.

3. Select the correct record by the filter.

4. Print the label

If this is possibile can somebody tell me how to do this.

I assume I have to do this with a VB script.

(I have experience in VB script but not in combination with Bartender)


Thank you in advance for your suggestions.

Di Martino





Peter Thane

What may make it slightly simpler also is to add the database filter onto the same Data Entry Form as the text field rather than the leave it on a separate screen. You can achieve this by adding a Text Input Box onto you form and with the Linked Data Source option chosen select the name of you query prompt as the item to link to.

Is there a way to tell what part of the barcode contains the text field data and which part will be the database lookup value? 

If the first X characters are always the lookup/filter value then a very simple option would be to setup Transforms>Truncation in your Filter (More Options button on the Query Prompts dialogue) and set  it to keep X number of characters. 

For the text field do the same thing but this time set the Transforms>Truncation in the label field properties to discard the first X characters.

At print time the uses would have to scan the code twice (NOTE: you may need to adjust the Data Entry options for the Database query entry for the settings Move focus when....Enter Key is pressed so that the cursor will move to the next field, depending on how your scanner if configured)  once for the database filter and the other for the text field but that would be a very simple solution to implement. 

(You could also add an Image>Preview of Template onto the same Data Entry screen and so as soon as the data is scanned into the first field then an image of the label with the appropriate database record details would be previewed on the screen).

I hope this helps


Alato Di Martino

Dear Pete,


Thank you for your detailed feedback.

Your solution is a good suggestion,

With your solution we should scan the barcode twice.

But we are searching for a solution (if possible) to only scan the barcode once.


Peter Thane

Hi Alato,

There maybe a way round scanning twice however but it depends how the code is made up?

Is the Database Lookup element a fixed length and in a fixed location in the code scanned?


Alato Di Martino

HI Pete,


Yes it is.

The barcode is a fix length and the data is always (lookup element) is on the same fixed location.

Please sign in to leave a comment.