Input Mask Nubie Needs Help! (Bartender Version 10)
I've never used the input mask feature in the "Barcode Properties" page and need some guidance. I've looked online and used the help function in Bartender but nothing is clear on how to acheive what I am trying to accomplish.
I'm trying to input code to address the following issue. Our packaging department scans the barcode imprinted on a product we manufacture and Bartender prints a box label which displays unit information along with a match serial number for use on the the unit box. Occassionally, the personnel in our packaging department pull up the wrong label type Bartender file (gives information about different product we sell) and they scan the part number on the unit so we have an incorrect label with the correct serial number created which is placed on a box and shipped that way. I'm trying to make the files for each product foolproof where Bartender will flag the packaging personnel if the serial number they are scanning does not match the correct label file. I believe the 'input code' function will address this. Below is an example of one of our labels:
Model name is '810', YY is a place holder for the last two digits in the current year, and XXXXXX is a random serial number so a serial number reading 81014123456 would mean an 810 model made in the year 2014 with a serial number of 123456.
How can I code the Character Filter Input Mask to ensure '810' exists in the first three digits of the serial number scanned from a product and allow eight digits (no more or no less) to following that three number prefix? I can customize all our individual files for each product type to do this.
Sorry for the long explanation. Please help and thank you.
You would use a VB Script. First though set the validation for numeric data only, and a min/max of 11 digits of input. Next choose the "VB Script" transforms option and enter in something like the below script which cancels the print request if the model name is not what you want it to be:
If Left(value,3) <> 810 Then Call Format.CancelPrinting("Wrong document for input provided!") End If
Note that you'll need to adjust this statement on a per BarTender document basis.0
Thanks. That did the trick.
Hi Ian (or if anybody else can help),
The VB code from your last response worked well for the individual unit label but when we tried to apply this same code to our multipack carton label, we received continual error messages. Rather than try to explain the mulitpack carton label, I've attached the file for your review. Our manufacturing engineer and myself spent about 90 minutes trying to figure out how to get this to work with no luck. We would be most grateful if you could take a look at the file and let us know your thoughts on how to apply this same feature from the unit label to each of the serial numbers listed on the multipack label.
Thank you for any assistance you can provide.0
Sorry - I forgot to attach the file in my last post. Thanks again.0
You could create a global document based VBScript instead, so that you check the value for each and every bar code. If one of the bar code values entered is not what it should be, you could then call "Format.CancelPrinting()". This type of VBScript is accessed from the "File > BarTender Document Options" dialog and now under the VBScripting" tab.
Further instructions on this document level VBScript are found on the following White Paper:
We didn't have any luck with the global command in VB scripting. We used the same code given by Ian in the earlier post and, although we received no errors, we could type anything into the print job as the data source and Bartender allowed it to print.
Just for further information, we went back and tried to use the original code in the individual serial numbers/barcodes (right-click over each individual barcode, clicked 'properties' and added the VB code given by Ian). I've attached the error message we are seeing when we try this method to prevent incorrect data entries. Please see the attached screenshot file. Please help and thank you.0
Can somebody please help with this?0
Thank you very much for your post. Checking the error message it seems that there is a configuration issue with the data source. Can you attach your label file to check it?
The error indicates that you've made a connection to a database/data file in your BarTender document, but that you then didn't use a data source in your label design that reads a field from the database/data file. This has little to nothing to do with a VB script as given earlier.0
The .btw file is attached at the top of this blog.
Thanks for helping with this.0
I took a look at your label file. As I stated previously, you have a DB connection setup, yet the data source for everyone of your objects is using embedded/fixed data. Either disconnect the DB connection, or use a DB field in the data source of at least one label object.0
Please sign in to leave a comment.