Are you trying to build a dynamic Query based on user input? In that case, the QBE Solution suggested by Pat Hartman (with Parameters) would be an good option. You can also make the QBE version, and use the SQL Code as a basis for the VBA Code that you are trying to create.
-- Rookie