Vb Script -> Print Preview Does Not Match Final Print
I have a label with some inputs before the label is printed. For the part number entry, I have a VB script that looks at a certain character. Based on the value of a specific character, a different shared value (IP) is changed accordingly. Here is my script within the part number:
OnProcessData
If Trim(Mid(Value,10,1)) = "S" then
IP = "21"
ElseIf Trim(Mid(Value,10,1)) = "E" then
IP = "21"
ElseIf Trim(Mid(Value,10,1)) = "F" then
IP = "24"
ElseIf Trim(Mid(Value,10,1)) = "T" then
IP = "24"
Else
Format.CancelPrinting("Bad Input Data")
end if
In my case, the character is "F". If I do a print preview, then IP = "24". If I perform an actual print, then IP = "21". I suspect that it may have something to do with my place-holder.
On my label, I have 123456789S as the default value, so that I know what to look for when I scan by barcode. I am actually scanning 123456789F, but my label prints IP = "21".
If I change my default value to 123456789F, the label prints IP = "24".
Why does my print preview not match what actually prints?
How can I get my input from the Prompt to over-ride my default value when the VB scrip runs?
-
Maybe you need to do this in an event based VB script. Normally you set a value to the value of the object within which the data source is running, rather than trying to set the data source of a different object container. Also, is IP supposed to be a named data source? If so then the correct syntax to reference it is: Format.NamedSubStrings("IP").Value
0 -
Thanks for the quick response.
My first reply is "Huh? What?". So let me at least explain the little that I do know about VB scrips.
I know about VB scripting within the confines of the screen data
Double-click 'PART'
More Options
VB Scripting
OnProcessData
Edit
That is where my script is currently located.
I know of another 'area' to include VB scripting
View
View Options
VB Scripting
**A number of events - not sure which applies to my situation**
Edit
My guess is that you are referring to the latter?
How do I distinguish between the Value(PART) that I am looking and the Value(IP) that I am changing?
0 -
What version of BarTender are you using?
0 -
What version of BarTender are you using?
BarTender 9.3 Enterprise Automation
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare