Of late people have been asking how to run queries with dynamic parameters. Here is a Word document on how to create public variables and pass them to functions which can be used in independant queries.