Skip to main content

Search

Search

Hide Object Based On Db Field

Comments

3 comments

  • Avatar
    Ian Cummings
    Moderator

    You're specifying a database field as containing the name of the object that you wish to set print visibility upon.  However, the field value only has a value in it at print/preview time unless you also set a default value for the field reference.

     

    Example: Field("printpalletfilm_label.cartons","RLCTEXP")

     

    The second parameter for the Field() function allow you to set a valid default, thereby allowing you to avoid errors like this at design time.

    0
  • Avatar
    Legacy Poster

    I wasn't sure which line to put a value in, so I did it on all lines.  Now I'm getting the error 'The object 0 was not found'.

     

     

    IF (Field("printpalletfilm_label.cartons","0") = 0) Then
    Format.Objects(Field("printpalletfilm_label.cartons","0")).PrintVisibility = False
    Format.Objects("RLCT").PrintVisibility = False
    Else
    Format.Objects(Field("printpalletfilm_label.cartons","0")).PrintVisibility = True
    Format.Objects("RLCT").PrintVisibility = True
    END IF

     

    0
  • Avatar
    Ian Cummings
    Moderator

    You need to specify a default that corresponds to an actual label object name.  As the error message states, there is no object named "0" in your label design.

    0

Please sign in to leave a comment.