Avatar of Jeremy Hayden
Jeremy Hayden
 asked on

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

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

Microsoft AccessVBASQL

Avatar of undefined
Last Comment
Rey Obrero (Capricorn1)

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Rey Obrero (Capricorn1)

a solution was provided
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy