Target Audience: Advanced User
Summary
BarTender has a way for label files to share common variables (e.g. serial numbers) (i.. It is called Global Data Fields (GDF). This article presents an alternate method of implementing the same capability without the limitations of GDF.
Situation and symptoms
- Labels from different workstations must share a variable (e.g. serial number counter)
- GDF feature used for shared variable
- Variable must be changed or reset automatically (e.g. serial number or part of the serial number must reset at specific times or intervals such as each week, month, etc.)
Explanation
For most people, the mechanism for GDF works as designed in BarTender. The problem comes if you need to manipulate the GDF values without using the serialization function in BarTender. The method presented in this article offers another method of implementing the capability of GDF but bypassing that particular limitation.
Since the value is encrypted in the BarTender SQL database, the user can only change the value in one of two ways:
- Manually reset the value in GDF using BarTender client
- Allow the serialization function to update it as designed when printing labels (i.e. accept that you cannot change it).
If your operations require that you periodically change the value of the serial number outside of the normal serialization functions (i.e. reset the counter each week or month automatically), you cannot use the GDF feature.
Solution
Step #1 – Create a new database (GBL) separate from BarTender’s SystemDB,
Step #2 – Add a table (you can call it ‘Global’) in GBL with at least 2 columns: Name, Value.
- Name = Name of the data field. It is also a primary key and unique
- Value = Value of the data field
Step #3 – Embed a VB script into the label design to manipulate the ‘fake GDF’ as needed. Download the linked Sample.zip file, below for an example.
In BarTender label design, instead of using the variable in GDF, the label design will:
- Retrieve the variable value from the Global table in GBL database with names corresponding to the variable name
- Change the value as needed
- Use the value in the label
- Write the final value back to the Global table
Please see attached Sample.zip file for a working example. You will need to make modifications to the SQL connect statement in the code.
Article# 7209