RunSQL

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

Guest

I am writting a 'labels' database that allows a user to query multiple cities
(1,2,3, etc). I know I can add the number of parameters in a select query,
but the user cannot choose the number of cities they would like to start
with. I have an input box that accepts an integer and with that through code
I am able to get the select statement I want with the right number of user
prompts. I know I can't use RunSQL because it only allows for action
queries. What can I do/use that will run the query string I have created?

Thanks Ken
 
Duane,

I've done that...Because the user could enter between 1 and 10 cities, I
don't want to have to manually change the query for a different city. My
where clause looks like this on the city column:

[Enter State 1] Or [Enter State 2] Or [Enter State 3]

Depending on the number that is entered, through code I create a WHERE
clause with the correct number of parameters. I then add the where clause to
the rest of the SELECt query and store it in a variable. I want to run a
label report based on this ever-changing query. The only way I can think to
do it is with code but I'm not familiar with how to run a query with VBA.

Any help would be appreciated.

Thanks,

Ken-
 
Back
Top