Actually, I've written a form that is a query builder for use by non-IT users in a menu driven system, so yes I've built queries in code.
However, since you want to let users use the Access query design, using the DoCmd.DoMenuItem option to open the query builder. (I don't know what the menu steps are, so you'll have to check them yourself.)
As far as I'm concerned, when not just have the database window visible. If you are letting your users use the query builder, then let them see the database window and call the new query design from the database window themselves.