Vb & Shared Data Sources Bug In Barcode ? Follow

Legacy Poster

Hi Seagull, hopefully you'll tell me I'm doing something elementary wrong


Ok, so I need to print a quantity in a text field with no leading zeros but this value also needs to be contained in a Code128 barcode with padding leading zeros to six characters & this then concates/is appended to a leading letter Q



I added the field as prompted text & named it Quantity



I created a non printing text field using as source a VB Script - Format.NamedSubStrings("Quantity").Value. This was padded with leading zeros to 6 characters & called it Qty_With_Pad





With the field now padded I added the barcode. Again using a VB field leading with a Q & the Qty_With_Pad following - "Q"+Format.NamedSubStrings("Qty_With_Pad").Value

I've added the human readable although this isn't required on the label.





All looks good - Until I scan the barcode. The barcode scan does not correspond with the human readable.


If I were to use just the original prompted text field padded with zeros in my barcode VB script it works. There seems to be an issue if I use the original field in a VB script to pad & then use this in another VB script for the barcode.


Unless of course I'm missing something ???


Legacy Poster
Comment actions Permalink


Fernando Ramos Miracle
Comment actions Permalink

Hello John,


I've sent you an email on this matter (you contacted us through email directly), but I'd like to provide an answer here too for other forum user's benefit:


The problem you are seeing is due to the type of VB script you are using and how BarTender actually works.
Currently you are using a "Single-Line Expression" VB script. When doing so BarTender needs to guess when it should run the script by its contents.
Understand that BarTender runs through a series of events: At print start, before the user prompt, after the user prompt, for each record, for each serialized copy, for each identical copy, at the end of the print job,…
In your case you need the script to run "After the user prompt", or the script won't receive the correct data. With your design as it is, BarTender doesn't know that the script needs to run at that time.
What you need to do to fix the issue:
1.     Change the type of VB script to "Event Control Scripts".
2.     Edit the script in order to add the appropriate code to the "OnPostPrompt" event (that is: the event after the user enters the data in the Data Entry Control).
The above will solve your issue, allowing you to get the appropriate data to the barcode.
Best regards.

Please sign in to leave a comment.