Whenever I try to define something as QueryDef (i.e. Dim MyQuery As QueryDef), it gives an error message saying "User-defined type is not defined". I'm only at a beginner's level with VB, so it's confusing when examples right out of help files give errors on the second line! I've tried defining things like this in Sub's and in Function's. Any help would be greatly appreciated.