This is just a crazy thought, but...
In the detail section, when you detect the condition that makes you want to close the report, raise an error. (Look up Help topic "Raise Method" on what and how to do this.)
In the overall report code, have a Report_Error handler that will be called when an error is raised. Have this code try to do the DoCmd.Close rather than letting the Detail_OnFormat (or whatever) try to close it.
In the Err.Raise method, everything but the number is optional - but I would advise including a couple of descriptive strings for the source and description parameters.
Unless you have written your own help file, which requires the SysDevKit, the helpfile and helpcontext items are a lost cause that are no good to you.
Good luck with this one, I'll freely admit I'm just guessing.