Using preprompt/postprompt value for VBscript
We would like to use Bartender for some automation, but with the current setting it seems to be impossible for us.
Example: There is a form where the operator has to input the price and quantity for 4 fields labeled (QTY), (QTY2),(PRC),(PRC2) . The fields are then calculated to produce an amount from the (QTY'S) and (PRC'S) which are then provided to another field named (AMT) and (AMT2) to display the value. The values of (AMT's) then need to be added together to receive a total amount labeled (SUB) and then proceed to printing,I can't find any setting how to use the value of the prompts properly within the VBscript.
The script runs perfectly to give the values of the (AMT's) from the (QTY/PRC's) but in the second step on calculation, does not process the (SUB) values totals properly from the new data entry.
if there is there no possibility to calculate with the user's input value?
Thanks in advance.
-
Peter Thane
★ BarTender Hero ★
It looks to me that the VB is running before the values have been set. Try adjusting it to an Event Controlled Script field and run the VB OnPostPrompt, ie after the other values have been specified.
I dont believe you will be able to display this on the Data Entry Form however.
0 -
kerry washington
★ BarTender Hero ★
I have adjusted the vb scripts to be event controlled OnPostPrompt but still having the issue. Please keep in mind that the 2nd script vbscript runs off the value calculation from the (AMT'S) addition to the (SUB) field. Thanks the quick response
0 -
kerry washington
★ BarTender Hero ★
0 -
kerry washington
★ BarTender Hero ★
How do I tell to run (ie) after the other values have been specified?
0 -
Peter Thane
★ BarTender Hero ★
It looks like you need to run the Cdbl commands separate to the addition.
I have also set the final addition to be processed OnIdenticalCopies so that it is after the other two OnPostPrompt commands have been run:
0 -
kerry washington
★ BarTender Hero ★
That worked perfectly, Thank you.
I'm also needing to now have the calculation total of this field show a discounted percentage before in a new field labeled (DIS) and then s displaying the final value in a new field labeled (TOT).0 -
Peter Thane
★ BarTender Hero ★
You could just copy and paste this Sub field, as above, and then add the new VB lines to the existing VB script such as
Value = Value * 0.85
for example for a fixed15% discount
0 -
kerry washington
★ BarTender Hero ★
Hi Peter it won't work. Please keep in that the (SUB) has its own field and that the discount has its own field that would reflect how much was saved and another field that would hold the total of all
0 -
kerry washington
★ BarTender Hero ★
Thanks for your lighting response time
0 -
Peter Thane
★ BarTender Hero ★
I dont know your label and what field is called what. You just need to make sure that the discount VB is run after the appropriate full amount has been calculated by any other VB routines, even if that means adding copying some code from another field and then adding to it to guarantee this
0 -
kerry washington
★ BarTender Hero ★
Happy Holidays Peter. I added another zebra printer to my phone for Bluetooth printing an I keep getting this same message an I’m not sure why since it’s the same model of printer. This happens while using print portal app
0
Please sign in to leave a comment.
Comments
11 comments