Switching Queries programically in a module...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I have a block of code that runs off of a query that is hard typed into the module. What i would like to do is be able to interchange the query for that module of code. How can i do that.

For example. If the user want to view data labels sorted by location, then that query is used, if they want to view data labels sorted by number, then that query is used.

Any ideas?

Thanks
Carlee
 
You need to re-write the Query to accept a parameter.
Then, write code to do each of the different types of
Query, and use an If/Else or Select Case block to choose
which type to run.

I would have the user choose the type of Query from a List
Box or Combo Box- but don't let them write in text that's
not there already. This way you don't need to write code
to check whether what they entered matches a type of Query.

Good Luck,

-Andrew Cushen
-----Original Message-----
Hi there,

I have a block of code that runs off of a query that is
hard typed into the module. What i would like to do is be
able to interchange the query for that module of code.
How can i do that.
For example. If the user want to view data labels sorted
by location, then that query is used, if they want to view
data labels sorted by number, then that query is used.
 
Back
Top