A compiled Pass-Through Query in the QueryDefs collection of a DAO database can be referenced in code like the following:
Set qdDAO = dbDAO.QueryDefs("qsptTaz3Test00")
qdDAO.Execute DB_FAILONERROR
where "qsptTaz3Test00" is the name of the compiled Pass-Through query and "qdDAO" is the name of a QueryDef object. Calling the Execute method of the QueryDef object may generate the error, "Can't Execute a Non-Action Query." This error will occur when the Returns Records property of the Pass-Through query is set to Yes.
Note: multiple SQL commands can be placed in an Access Pass-Through query but it is not recommended to mix select statements with SQL that does not return records like update statements.