Peter,

To answer your questions:
Better not to let that error happen in the first place. Check for the existence of a related record by "Not IsEmpty(childTable::KeyField)".
do NOT use "IsValid()" as suggested by Tim Mansour. See post by Steve Moore.

Jim Brear suggests to check for the number of found records in the child table which could also be written as
If [ Not IsEmpty(childTable::KeyField)" ]
  do your stuff
End
As you see this is exactly the same check already done above, hence superfluous as Jonathan Fletcher pointed out.

If there are no related records GTRR will keep you on the current layout. It does NOT change the found set in the child table.


Other statements in this discussion can not remain unchallenged:

Richard Russel has a field "One" =1 in every table.
This is clearly pre-FileMaker-7-think and can be omitted completely - as calculation or as auto-enter field.
More important is unique ID for every record in every table, even it does not seem necessary at the moment but my come very handy with possibly restructuring the solution later. It also serves as the parent ID for all child tables.

Having a Value List called "One" is a good idea.


Winfried

--
Check out the new FMDiff 2.0 to compare two FileMaker files and test for file corruption at <http://www.fmdiff.com>



On 22.06.2011, at 12:26, Peter Buchanan wrote:

> When using the Go to Related Record script step, is there a specific error
> code to look for with Get Last Error, for example if there are no related
> records? I am trying to figure out what happens if there are no related
> records :
> 
> I am using GTRR, and then importing the related records into another table.
> How do I ensure only the related records (matching the current record) are
> imported? Will GTRR still go to the layout (in related table) specified in
> this command, even if no related records? Will the found set in related
> table be nil records if no related records, or will it comprise all records?
> 
> Much appreciate any advice on checks to use with this script step.
> 
> Regards
> Peter