Ah. Use QueryDef.

Over the past few years, this would have solved numerous problems.