Access 2003 replaces subquery parens with square brackets

K

Keith

I have code that ran fine in Access 2000, but it fails in Access 2003.
The code changes the .RecordSource property of a report to a different
SQL string that contains a couple of subqueries. I can cut and paste
the string into a new query window and it runs fine. I can paste it
into the RecordSource field in the report's property window, then
click the builder button and execute the query from there with no
problem. But if I attempt to open the report I get a 'Syntax error in
From clause' error because when saving the report, Access replaced the
parentheses surrounding my subqueries with square brackets. So, "LEFT
JOIN (SELECT yada yada yada) d ON ... " becomes "LEFT JOIN [SELECT
yada yada yada] AS d ON ... " and that doesn't work. Any ideas?

TYIA
Keith Ketchum
 
G

Gina

First thing I would check is references, under Tools (from
the MenuBar on the Code Window behind a form)...

The second thing would be you might have to add
DAO.Recordset in your declarations...

Hope that helps...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top