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
460 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
  • 3
5 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
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
Comment Utility
Dumb:

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

Author Closing Comment

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

Expert Comment

by:GRayL
Comment Utility
Thanks, glad to help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now