I have the following working SQL in my Function;
strSQL2 = "SELECT Merch.Loc, Merch.Hub, Merch.Item, Merch.[Total Qty], Merch.[Avg Cost]" & _
"into TblTemp2 " & _
"FROM [Merch]" & _
"WHERE (((Merch.Item)= '1387' ));"
I want to replace 1387 in the last line with a variable called itm, the string below doesn't work, despite trying about 1000 syntax permutations!
strSQL2 = "SELECT Merch.Loc, Merch.Hub, Merch.Item, Merch.[Total Qty], Merch.[Avg Cost]" & _
"into TblTemp2 " & _
"FROM [Merch] WHERE (Merch.Item)" & " = " & itm & ";"
What did I screw up?
Thanks
Don