Trying to print multiple labels with calculated field for quantity on label Follow

Randi Hickman


I am trying to prompt the user for a WorkOrder number, retrieve 3 fields from the database and then calculate the quantities on the labels that will be printed on the labels. For example:
If the total order quantity is 41 and the order requires 21 labels the quantities for the labels should be:

Qty: 2 (on each of 20 labels) and
Qty: 1 (on the last label)

Can you please tell me how to do this?  I am executing this code 'OnPostPrompt'
Here is what I have so far, but the output is the last label only:

Dim totalLabels, totalQuantity, count, thisPrintCount

totalLabels = CInt(Format.NamedSubStrings("totalLabels").Value)
totalQuantity = CInt(Format.NamedSubStrings("totalQuantity").Value)
Copies = totalLabels

While count < totalLabels

if totalQuantity Mod totalLabels = 0 then
Value = totalQuantity / totalLabels
totalQuantity = totalQuantity - Value
Value = totalQuantity Mod totalLabels
end if

count = count + 1


It seems there is no execution of the code, like a PRINT command that I can use.


Please sign in to leave a comment.