Somewhere I recall reading that it was very bad to put SQL in your vba code, but it was ok if it was in stored queries and executed by the vba, but I can’t remember why. I thought that putting SQL in the vba code was unavoidable in certain situations but now that I’ve learned a bit more about QueryDefs I see that I could put a lot more (perhaps all) of my SQL in stored Querydefs. I’m wondering if I should. Can anyone tell if and why it’s bad to have SQL embedded in vba and if so does this also apply to using Dcount and DLookup?