I am getting "Run-time error '3075' when running the following code. Please help.

Jeremy Hayden
Jeremy Hayden used Ask the Experts™
on
I am getting the error on the WHERE clause on line 12

Sub LEASEEXECUTIONFINALFILTERED()
DoCmd.RunSQL "SELECT LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LEASEEXECUTIONEXTRACT_Key ID], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Store Name], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Center Name], " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.LEASEEXECUTIONEXTRACT_Brand, LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LEASEEXECUTIONEXTRACT_Store Type], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.Document, " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LL / Developer], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LEASEEXECUTIONEXTRACT_Deal Maker], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Business/ Approval Date], " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Legal Package Submission Date], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[RE Targeted Full Execution Date], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Date of Possession], " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Construction Start Date], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Open Date / Effective Date (Extensions)], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Lease Fully Executed Date], " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Approved?], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.LeaseAdminTrackerMergeTable_COMMENTS, LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.LEASEEXECUTIONEXTRACT_Status, " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LEASEEXECUTIONEXTRACT_Target Approval Month], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LeaseAdminTrackerMergerandGRELRENATable_Key ID], " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LeaseAdminTrackerMergerandGRELRENATable_LEGAL LEAD], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[GREL RE NA Extract_COMMENTS], " & _
"LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LeaseAdminTrackerMergerandGRELRENATable_FULLY EXECUTED], LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[LeaseAdminTrackerMergerandGRELRENATable_DOCUMENTS DISTRIBUTED] INTO [LeaseExecutionFinal-Filtered] " & _
"FROM LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable " & _
"WHERE (((LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.LEASEEXECUTIONEXTRACT_Status) = ('In Legal','Pre-Approval','Preparing for Legal')) AND ((([LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable].[Document])=[Document]) Is Not Null And (([LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable].[Document])=[Document]) Is Not Null)) " & _
"ORDER BY LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.[Store Name];"
End Sub

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
change the equal "=" sign with IN

"WHERE (((LeaseAdminTrackerMergerandGRELRENAandGRELOPTIONSTable.LEASEEXECUTIONEXTRACT_Status) IN ('In Legal','Pre-Approval','Preparing for Legal')) AND
Top Expert 2016

Commented:
a solution was provided

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial