Solved

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

Posted on 2008-10-08
5
464 Views
Last Modified: 2012-05-05
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

0
Comment
Question by:jad0083
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22673865
yes you can use a union query to do that

see this link for example

http://support.microsoft.com/?kbid=210290
0
 
LVL 44

Expert Comment

by:GRayL
ID: 22673877
Try:

Select Distinct Sub from questions etc.
UNION All
Select top 1 'All' From questions;
0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
ID: 22673885
Dumb:

SELECT Distinct Sub FROM questions etc.  - as you had written it
UNION
SELECT "All" FROM questions
0
 

Author Closing Comment

by:jad0083
ID: 31504469
Thanks for the quick solution, exactly what I needed, thanks!
0
 
LVL 44

Expert Comment

by:GRayL
ID: 22674038
Thanks, glad to help.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question