Hi Guy's, got this working great now, only one more question is, where I have Like or other criteria's in the statement, how do i change that to a string rather rather than double quotes on a specific customer ?
ie: where i have highlighted red, can this be changed to a string for user input ?
Also once where it says Dave, i may well be changing the other criteria's to a 'Like' rather than a 'specific'
Code:
strSQL = "SELECT tblAssign.Customer, tblAssign.[Year], tblAssign.[Month], tblAssign.Source, tblAssign.ItemType, Count(itemType) AS Totalitems" _ & " From tblAssign" _
& " GROUP BY tblAssign.Customer, tblAssign.Year, tblAssign.Month, tblAssign.Source, tblAssign.ItemType" _
& " HAVING (((tblAssign.Customer) Like ""*"" & ""Dave"" & ""*"") And ((tblAssign.Source) = ""WGM"") And ((tblAssign.ItemType) = ""June7""))" _
& " ORDER BY tblAssign.[Year] DESC , tblAssign.[Month] DESC;"