A
alex
I’m curious why my listbox treats SQL code differently than a regular
query object.
I’ve created this code to avoid having to create two queries:
SELECT tblSource.CatorKey, tblSource.Abbreviation
FROM tblSource LEFT JOIN
(select tblDestinationCase.CatorKey
from tblDestinationCase
where tblDestinationCase.CaseName = [forms].[frmResearch].[CaseName])
subq
ON tblSource.CatorKey = subq.CatorKey
WHERE (((tblSource.Group)=[forms].[frmResearch].[txtWhatGroup])
AND ((tblDestinationCase.CatorKey) Is Null));
The above code works perfectly in a regular query object. When I
paste the same code into the Row Source of a listbox and hit the
datasheet or design view button everything looks fine. I then save
and close the listbox and when I try to open the form I get “Syntax
error in FROM clause.” I can’t even modify the SQL in the listbox
because of the error.
The listbox column count is: 2
Any ideas why the query works in one situation and not another?
Thanks,
alex
query object.
I’ve created this code to avoid having to create two queries:
SELECT tblSource.CatorKey, tblSource.Abbreviation
FROM tblSource LEFT JOIN
(select tblDestinationCase.CatorKey
from tblDestinationCase
where tblDestinationCase.CaseName = [forms].[frmResearch].[CaseName])
subq
ON tblSource.CatorKey = subq.CatorKey
WHERE (((tblSource.Group)=[forms].[frmResearch].[txtWhatGroup])
AND ((tblDestinationCase.CatorKey) Is Null));
The above code works perfectly in a regular query object. When I
paste the same code into the Row Source of a listbox and hit the
datasheet or design view button everything looks fine. I then save
and close the listbox and when I try to open the form I get “Syntax
error in FROM clause.” I can’t even modify the SQL in the listbox
because of the error.
The listbox column count is: 2
Any ideas why the query works in one situation and not another?
Thanks,
alex