Depends on how things are laid out. One way that comes to mind
1. On your script, when field 1 = yes, set a flag field (doesn't have to be on layout) to = 1 (checkbox set, one value in value list 1)
2. Set conditional formatting for fields 2, 3, 4 so when flag field = 1 (flag field value in value list tied to checkbox set), change field color to invisible (or match background color)
When you close layout, or after printing in the script, reset flag field to ""
That may work but the trick is I want to get rid of the blank space when printing. So I need a script that hides the fields and moves the fields below it up into place.
No script is needed.
If this is FileMaker 13, put this expression into the "hide when" box in the Inspector while these fields are selected in layout mode:
( Get ( WindowMode = 3 ) or Get ( WindowMode ) = 2 ) And YourTable::field1 = "Yes" )
This will hide the selected fields in preview or print window modes if field1 = "yes".
Then use the sliding and visibility settings on the Inspector's position tab to set the fields to "slide up" and to "resize enclosing part".
Key facts about sliding layout objects:
- It's only visible in preview mode and when you print/save as PDF...
- Sliding fields will shrink but not expand.
- All layout objects below and in the same layout part as the slide/resize field need to also be set to slide up and resize.
- Objects in headers and footers will not slide.
- Portals will shrink/slide to fit the number of rows of records, but fields within the portal row will not shrink/slide.
- Fields will slide up only if Top alignment is specified for it and will slide left only if Left alignment is specified.
- Consistent side borders are difficult to achieve with sliding fields.
- In FMP13, hidden objects (”Hide object when”) will slide/resize.