AnsweredAssumed Answered

Selecting child record with variable

Question asked by Bonnerbl on May 20, 2010
Latest reply on May 20, 2010 by Bonnerbl


Selecting child record with variable


Using Filemaker 10/11. What am I doing wrong here?


I have a table of ITEMS and a related table of PHOTOS of the item. The PHOTO records can be "Printing", "Nonprinting", "Comparable", etc. There may or may not be a related photo for every type.


ITEMS: Item record id, g photo filter

PHOTO: Photo record id, Related item record id, Photo, Photo Type.


The PHOTO table is a child of ITEMS.


I defined a second relationship between ITEMS and PHOTOS where Item record id = Related item record id AND g photo filter = photo type. So that is table PHOTO2.


Some of the ITEMS have only one child and it is "Nonprinting", or "Comparable".


My layout has several fields from ITEM and one field (the photo itself) from PHOTO2.


In my script I say --

...step where I test to see if a report with photos is being requested...

Set Field By Name [Item::g photo filter;"Printing"]

Go to Layout ["Items with Photos"(Photo2)

Show All Records

Sort Records, Adjust window, Scroll window, etc..

Go to Record/Request/Page [First}


What is happening is that the report always is displaying a photo whether or not it is a "Printing" photo.

E.G. - one of the ITEM records has only one associated PHOTO and it is a "nonprinting" type. But that photo is appearing on the layout.


Been struggling with this for several days. Appreciate any feedback or pointers to where I might look.