Comparing Two Prompt Values
Hello
Is there a way of comparing two prompt values to determine if they are the same before printing the label.
ex) Format.NamedSubString("txtBID1").value = "123456"
Format.NamedSubString("txtBID2").value = "123456"
If txtBID1 = txtBID2 then continue printing
else
CancelPrinting with an error prompt.
I have tried using OnProcessData to compare the value of txtBID1 to txtBID2 but it doesn't capture the inputted value for txtBID1 from the prompt window properly and always claims they are not the same.
*Further notes. The value of txtBID1 and txtBID2 are unknown(empty) until print time. They are blank on the template label and the values are inputted via the prompts.
Bartender version 9.4
-
Shotaro Ito
★ BarTender Hero ★
Hi sigmapoint,
Event control script "onPostPrompt" Event takes such request.
create a text and select data source as VB Script, Event control script.
In OnPostPrompt event,
'Called after the data entry form is closed either at the beginning of print job or once 'every record, depending on the defined frequency options. if Format.NamedSubStrings("txtBID1").Value <> Format.NamedSubStrings("txtBID2").Value Then call Format.CancelPrinting("Data must be the same - printing cancelled","") End ifCancelPrinting's 2nd parameter specifies "Continue" button label. If "" is specified, it doesn't give you option to print.
[attachment=988:VBS-compare data.png]
0 -
Thank you so much this works as I was hoping it would.
0
Please sign in to leave a comment.
Comments
2 comments