Yes, you can return values from a module to a query using
a custom function. You can also do the reverse by
opening a query definition in VB and passing variables to
parameters.
Or, you can just construct the sql string in VB using a
combination of variables and strings.
It's hard to give much more detail without knowing more
about what you are trying to do. Post back if you would
like more specifics on one of the options.
-Ted Allen