hi Allen,
Allen_N wrote:
[Quoted Text] > Here's a weird one. The code > > Set qy = CurrentDb.QueryDefs(strSourceQuery) > strSQL = qy.SQL > > Set qy = CurrentDb.QueryDefs("Kits Found Special") > qy.SQL = strSQL > > produces error 3131: "Syntax error in FROM clause", despite the fact that > the 1st query works fine if run from the database window. > (note that Access added the "]. AS [%$##[ at ]_Alias]" foolishness, not I).
This alias is need by Jet to run the query. Access use this not so nice default alias, which is not reusable as you have noticed.
The simple solution is to use a extra query for your subselect.
btw, under Access 2003 this probem is fixed.
mfG --> stefan <--
|