Populating Combo Box with certain select queries

JTQ911

Registered User.
Local time
Today, 12:58
Joined
Jul 26, 2007
Messages
83
I have a form that has a combo box that contains every query in my database. This worked fine until i started having to create cascading queries to return the data I want. How can i populate my combo box with only certain queries in my database.

This is the code I was using to put all queries into my combobox.

FROM MSysObjects
WHERE MSysObjects.Name NOT LIKE "~*" AND
MSysObjects.Type = 5
ORDER BY MSysObjects.Name;

Upon clicking a button or clickin the query in the list, I want the query to run......So the main question is how to I include certain queries in my combo box but not all of them? I do not know SQL or any programming, so as specific as possible will help immensely. Thank you everybody.
 
This is the code I was using to put all queries into my combobox.

FROM MSysObjects
WHERE MSysObjects.Name NOT LIKE "~*" AND
MSysObjects.Type = 5
ORDER BY MSysObjects.Name;
The easiest way (if you don't have a large number of queries), is to write another AND operator, with the OR separator:
Code:
WHERE MSysObjects.Name NOT LIKE "~*" AND
         MSysObjects.Type = 5 [color=red][b]AND[/color][/b]
  [COLOR="Red"][B]([name] = 1stquery OR [name] = 2ndquery OR etc, etc...)[/B][/COLOR]
         ORDER BY MSysObjects.Name;
 

Users who are viewing this thread

Back
Top Bottom