Zum Hauptinhalt gehen

Suche

Suche

Print Number Of Labels From Field Value In Query

Kommentare

4 Kommentare

  • Avatar
    Ian Cummings
    Moderator
    Data source the copies to print quantity.  For the data source type choose a VB script - event controlled script.  In the OnNewRecord event write an expression that calculates what you wish the data source, and thus the number of labels to print, to be.
     
    For example:
     
    If Int(Field("MyTable.Qty",6) / 1) <= 1 Then
        value = 1
    Else
        value = Int(Field("MyTable.Qty",1) / 6)
    End If
        
    *Note the use of "1" for the second parameter in the field function simply sets the default value of the field at design time to 1 in order to avoid annoying errors appearing when not actively connected to the DB.  We use the Int() function to ensure we get a whole number, and the If...Then statement is to ensure we get a minimum returned value of 1 for the print quantity.
    0
  • Avatar
    Legacy Poster

    So once I get this value, how do I tie it so that the number of labels calculated by this will print automatically? I tried a couple of different methods and nothing works so far.

    0
  • Avatar
    Legacy Poster

    I have the same problem as jcbyrdman. The property "Format.IdenticalCopiesOfLabel" is read only. How do I write a script to print multiple copies of the same label based on a database value. Ian's post shows how to calculate the quantity; how do we actually print that quantity?

     

    thanks

     

    Roy

    0
  • Avatar
    Legacy Poster

    Ok, so go to the print dialog box, and click the little hand Icon next to the "copies" field... sigh.

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.