Conditional Quantity No. and Nos.
Hi,
Please help to apply the condition in vbscript
if qty is <= to 01 then it should be no.
else if the qty is > than 01 then it should be Nos.
please support me to apply this condition.
Thank you
-
Peter Thane
★ BarTender Hero ★
What do you mean by no. and Nos?
Is it if less than 1 it equals 1 or otherwise print the number of labels?
0 -
Vishal B Shah
★ BarTender Hero ★
Hi,
no i mean if it is 1 then No. and if it is 2 then it should be Nos.
i want to apply this conditioning
0 -
Peter Thane
★ BarTender Hero ★
Sorry that is still unclear to me.
What do you mean by No. do you mean Zero, the work "No" or something else?
The same question applies to Nos
Could you include an example of each, ie 0.5 = ? whilst 1.1 = ?
(In English the word number is often abbreviated to No. or Nos. for multiple numbers so that isnt helping with trying to grasp what you are trying to achieve as i dont know if you are applying that abbreviation here)
0 -
Vishal B Shah
★ BarTender Hero ★
Hi,
Yes i'm willing to apply the Unit of measures to quantity field.
Example:
1 = No.
2 = Nos.
how to apply this condition in vbscript.
0 -
Peter Thane
★ BarTender Hero ★
Something like this should do the job:
Note: I used an Event Controlled OnPostPrompt routine as I was typing in the base value to check against and had named the field QTY so I could reference it more easily. If yours comes from a database then you could use the OnNewRecord.
0 -
Vishal B Shah
★ BarTender Hero ★
Hi,
Thank you for your Support
Now, i'm getting an error: OnPostPrompt (Line 3): Type mismatch: '[string: " Nos."]
i have attached the screenshot for your reference and i request you to help me in resolving the mistake.
Thanking you
Vishal Shah
0 -
Peter Thane
★ BarTender Hero ★
The Named Data Source cannot be the VB field it needs to be the field or source of the < or > 1 field
On my test label the text field with the "1" is QTY whilst the "Nos" field is VB Script routine. The "1" is linked to a Data Entry Form input box so that I can type in the value to test it
0 -
Vishal B Shah
★ BarTender Hero ★
Hi,
I have followed as you suggested Named Data Source is "boxqtys" and this is now referred in "qty" field as VB Script
in OnNewRecord and now i'm not getting the error but i even did not get the result, i have attached the screenshots for your reference.
0 -
Peter Thane
★ BarTender Hero ★
And if you print the label does it appear?
Sometimes I have noticed the VB will not appear on the Preview of Template images as I assume it is being applied after the Preview is being created. In this case you are selecting the record at the same time as trying to apply the VB but these fields are not dynamic on the Preview like the text objects
0
Please sign in to leave a comment.
Comments
9 comments