VBScript to cancel print if data contains a specific letter 追蹤

0
Avatar
Christine Wattley

using a scanner to enter data, I want check the data scanned and cancel printing if the data scanned has an "N" in the 22nd character; as in this entry FGB123001372:LKE4655JN677 and return an error message "Wrong Label Program"

I am new to VBScript, any help is appreciated.

2 意見

0
Avatar
Shotaro Ito
評論操作 永久連結

Create a text and link to text input box on a form.

On the text's Data source > Transform, apply VB Script below:

OnProcessData

If Mid(Value,22,1)="N" Then call Format.CancelPrinting("Wrong Label Program","")
0
Avatar
Christine Wattley
評論操作 永久連結

Thank you!  this worked just as expected.

登入寫評論。