Skip to main content

Search

Search

Print Field Conditionally On Value Of Another Field

Comments

3 comments

  • Avatar
    Ian Cummings
    Moderator

    Yes you can do this one way or another.  First though, how are field 1 and 2 getting their data?  From a data entry form, database field, other??

    0
  • Avatar
    Legacy Poster

    Bartender Commander is getting a .btxml file with all of the fields.  The fields in the label design are Embedded Data.  Does that help?  Here's the VB Script I tried, but I know almost nothing about VB Script so it was a shot in the dark....

     

    IIF Format.NamedSubStrings("@ProdOrderComments").Value = "",Format.NamedSubStrings("@PRDNumber").Value = Format.NamedSubStrings("@PRDNumber").Value,Format.NamedSubStrings("@PRDNumber").Value = ""

    0
  • Avatar
    Ian Cummings
    Moderator

    What version/build of BarTender is this exactly?

     

    So I suppose that your setting data source values directly from XML using the NamedSubString tag?

     

    You could use the document level VB scripting to do what you want.  Find this via the "File>Document Options" menu item, select the "VB Scripting" tab and then enter in something like the below code for an appropriate event.

    If Format.NamedSubStrings("Field1").Value = "" Then
    	Format.Objects("Text 1").PrintVisibility = True
    	Format.Objects("Text 2").PrintVisibility = False
    else
    	Format.Objects("Text 1").PrintVisibility = False
    	Format.Objects("Text 2").PrintVisibility = True
    End If
    

    This white paper should also be useful to you:

     

    http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Dynamically-Changing-Objects-At-Print-Time-Using-VB-Script.pdf

    0

Please sign in to leave a comment.