How to add item to a combobox Rowsource (table/query) that is not part of the query statement.

Good Afternoon,

I have a simple ComboBox that queries the items from a table.  Is it possible to programatically add items to that combobox that is not on any field in the table.  The logic behind this is that I'm using the queried items from the table as a means to filter another query.  I'm hoping to add "all" as part of the rowsource on the combobox.

Attached is the simple query:
substr = "SELECT DISTINCT Sub from Questions WHERE Questions.LOB = '" & strind & "' ORDER BY 1 ASC;"

Open in new window

jad0083Asked:
Who is Participating?
 
GRayLConnect With a Mentor Commented:
Dumb:

SELECT Distinct Sub FROM questions etc.  - as you had written it
UNION
SELECT "All" FROM questions
0
 
Rey Obrero (Capricorn1)Commented:
yes you can use a union query to do that

see this link for example

http://support.microsoft.com/?kbid=210290
0
 
GRayLCommented:
Try:

Select Distinct Sub from questions etc.
UNION All
Select top 1 'All' From questions;
0
 
jad0083Author Commented:
Thanks for the quick solution, exactly what I needed, thanks!
0
 
GRayLCommented:
Thanks, glad to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.