Make a query to contain your SQL.
Set the report RecordSource to that query.
In code:
Build your sql string.
Change the query's' SQL property to that.
Example:
stSql = stSql & strWhereClause & ";"
CurrentDb().QueryDefs("myQuery").Sql = stSql
Voila. You report will use what you built in "stSql" from now on.
This seems like a good way to do this (I am a newcomer to Access.)
- Andy Rice
San Diego, CA