I am slowly converting my Access ADP to DAO/Odbc linked Access 2013 to a 2012 SQL server. I have some problems when trying to join tables in a .runSQL access command. It comes back with a "JOIN expression not supported" error.
Here is my code:
With Access.DoCmd
.RunSQL "INSERT INTO TempChildFind(ChildId, AcctId, CurrSite, SecSite, ThirdSite, PrimarySite, AuditId) " _
& "SELECT RefChildID, AccountId, CurrentSite,SecondarySite, TertiarySite, BillingSiteID, " & AuditID & " " _
& "FROM AccountChildReference " _
& "INNER JOIN AccountMaster ON AccountId = acct_ID " _
& "WHERE CurrentSite = " & Me.comboSelectSite & " Or " _
& "SecondarySite = " & Me.comboSelectSite & " OR TertiarySite = " & Me.comboSelectSite & " ORDER BY " _
& "AliasLName asc, AliasFName asc, AccountID asc
End With
This INSERT INTO/SELECT statement works fine when running it in SQL Management Studio, but gets the Join support error when running it in VBA.
Should I be using the .runSQL docmd in this case?