Vb & Shared Data Sources Bug In Barcode ? Follow

0
Avatar
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

[attachment=1746:Capture1.JPG]

 

I added the field as prompted text & named it Quantity

[attachment=1747:Capture2.JPG]

 

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

[attachment=1748:Capture3.JPG]

[attachment=1749:Capture4.JPG]

[attachment=1750:Capture5.JPG]

 

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.

[attachment=1751:Capture6.JPG]

[attachment=1752:Capture7.JPG]

[attachment=1753:Capture8.JPG]

 

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 ???

2 comments

0
Avatar
Legacy Poster
Comment actions Permalink

Bump

0
Avatar
Fernando Ramos Miracle
Moderator
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.