I have the following SQL Statement that works fine in SQL Server but in Access gets me an error
\'ERM_HAZARD.[HAZARDID] = ERM_XREF_HAZARD_CAT.[HAZARDID]
INN
To add to this. If you are creating a Pass-Through Query, you need to identify the connections string before declaring the SQL.
sub test()
Dim dbs As Database
Dim qdf As DAO.QueryDef
Dim rstSQL As DAO.Recordset
Dim strSQL As String
On Error GoTo errTrap
Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("")
qdf.Connect = ConStringMailing
qdf.ReturnsRecords = True
qdf.SQL = "Select * FROM TABLE"
Set rstSQL = qdf.OpenRecordset
errTrap:
end sub