I am trying to join a table from a list box (Me!Combo) to another table in my SQL statement. I am getting an "Object doesn't support this property or method - error 438" The code works fine without the Join or Where clause. What am I missing?
Code:
Dim db As Database
Code:
Dim rst As Recordset
Code:
Dim strsql As String
Code:
strsql = "SELECT [Cost ctr], Grp([Cost ctr],[Cost ele]) AS Description, Sum([Value COCurr]) AS Total "
Code:
strsql = strsql & "FROM " & Me!Combo & " "
Code:
strsql = strsql & "INNER JOIN " & Me!Combo & " ON " & Me!Combo.[Cost ctr] & " = tblCost_ctr.Cost_ctr "
Code:
strsql = strsql & "WHERE ((([tblCost_ctr].[Org]) = " & Me!Combo23 & ")) "
Code:
strsql = strsql & "GROUP BY [Cost ctr], Grp([Cost ctr],[Cost ele]) "
Code:
strsql = strsql & "ORDER BY [Cost ctr], Grp([Cost ctr],[Cost ele]);"
Code:
Set rst = db.OpenRecordset(strsql)