I need to change one of two things with code in a formula in MSAccess 2000 - either the SQL of a Query or the RecordSource of a Report. Unfortunately I can not figure out how to reference the query in code, and when I try to change the RecordSource of the Report, I get the error that I cannot reference or set a value of an object that does not have the focus.

Any hints would be greatly appreciated.

Thank you

Andrew