What i have done is written a query that looks for any related records. I then write code
if dcount("*","queryname"....etc)>0 then
....action to be taken if theres is a related record
else
runsql(deletequery here)
end if
Might be clumsy but it works a treat
If you're good at the dcount...