Mike Blackman
Well-known Member
- Joined
- Jun 8, 2007
- Messages
- 2,494
Hi All,
I'm trying to code a Make Table Query and assumed what I was doing was correct but I get an error stating that "Query Input must contain one Table or Query", don't know what the problem is, the SQL is as per the Query in Access.
And help is greatly appreciated.
I'm trying to code a Make Table Query and assumed what I was doing was correct but I get an error stating that "Query Input must contain one Table or Query", don't know what the problem is, the SQL is as per the Query in Access.
And help is greatly appreciated.
Code:
Sub RunQry()
Dim StrSql As String
StrSql = "SELECT IP_Flow_0_Tbl.SrcIp, Lokationen.[Location 1], IP_Flow_0_Tbl.DstIp, Lokationen.[Location 2], IP_Flow_0_Tbl.Application, Sum(IP_Flow_0_Tbl!BytSent) AS SumOfBytSent INTO Source_Locations_Tbl" _
& "FROM Lokationen, IP_Flow_0_Tbl" _
& "GROUP BY IP_Flow_0_Tbl.SrcIp, Lokationen.[Location 1], IP_Flow_0_Tbl.DstIp, Lokationen.[Location 2], IP_Flow_0_Tbl.Application" _
& "HAVING (((Lokationen.[Location 1]) Is Not Null));"
With DoCmd
.SetWarnings False
.RunSQL StrSql
.SetWarnings True
End With
End Sub