Help With If Then Else
I am new to vbScripting in BarTender and need help with following. I am trying to do something which should be relatively easy, I want he Qty in a box to appear except on last label I want Qty in last box to appear.
I have a basic label getting a few fields from a SQL view. I have added 5 shared DataSources to this label.
SharedDataSource1 = QtyInBox
SharedDataSource2=QtyInLastBox
SharedDataSource3=RecordNo - this is a Type = Print Job Field and Field = Page Number
SharedDataSource4=TotalNoOfLabels - This is a Type = Print Job Field and Field = Total Number of Pages
I also have a print dialog Data Source = Copies
Therefore when a user prints a label he is asked to enter number of labels (Copies), QtyInBox, QtyInLastBox.
I then have a SharedDataSource5 with a multi line vbScript as follows
-
When you are assigning the value of the Data Source in question, you need to put "Value = ".
So inside your If statement should be:
Value = Format.NamedSubStrings("QtyInLastBox").Value
or
Value = Format.NamedSubStrings("QtyInBox").Value
0 -
Thanks Guru
Changed my statement as suggested
If Format.NamedSubStrings("RecordNo").Value >= Format.NamedSubStrings("TotalNoOfLabels").Value ThenValue = Format.NamedSubStrings("QtyInLastBox").ValueElseValue = Format.NamedSubStrings("QtyInBox").ValueEnd IfBut still get the same 6900 error0 -
Is there any more information on the error screen than that? I do not have an issue with that code - can you attach the .btw file to a post?
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare