Build the sql query in your access database before attempting to replicate it in your code. If you use the interface of the Access query wizard then you don't need to write this using sql directly. Once the query is built, you can look at it in SQL view and then copy that across to your VBA code.
At the very least you need to get the spaces right in your SQL string. The square brackets are useful when field names have spaces but are optional in what you appear to be dealing with however you MUST have spaces in the right places and can't truncate field names like you do.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|