Lets say you have two main tables and three detail tables for the first table and three detail tables for the second table. To show links to the detail tables for current master table only use Menu page: Modify event on the Events tab.
Here is a sample:
global $strTableName;
if ($strTableName=="MasterTable1")
{
//show detail links for the first table
if ($menuItem=="DetailTable1" || $menuItem=="DetailTable2" || $menuItem=="DetailTable3")
return true;
//hide detail links for the second table
if ($menuItem=="DetailTable4" || $menuItem=="DetailTable5" || $menuItem=="DetailTable6")
return false;
}
if ($strTableName=="MasterTable2")
{
//hide detail links for the first table
if ($menuItem=="DetailTable1" || $menuItem=="DetailTable2" || $menuItem=="DetailTable3")
return false;
//show detail links for the second table
if ($menuItem=="DetailTable4" || $menuItem=="DetailTable5" || $menuItem=="DetailTable6")
return true;
}