CBO Rowsource

systematic

Registered User.
Local time
Today, 07:09
Joined
Sep 13, 2005
Messages
28
Hi all,

It's been several years since I last did anything with Access. I'm trying to find my feet again so please bear with me :D

I have a basic SELECT DISTINCT query for my CBO rowsource.

Is it also possible to add custom values to the rowsource?

i.e. I'd like my CBO to look like....

Custom Value
Query Value
Query Value.....

Thanks in advance,

Rob
 
yes, you can use a Union Query, something like

SELECT yourfield
FROM yourtable WHERE yourcriteria

UNION SELECT "<your text>"
FROM yourtable ORDER BY yourfield;
 
Thanks CazB - sorry I should have been clearer. The custom value does not come from a table/query - it's just a string (or multiple text values) that I want to specify.

I could a table to house the data....but it seems pointless if there is an easier way?

EDIT: To make it clearer, what I want to do is have multiple Rowsource Types in a single CBO. So it is made up of a value list & results of a query.
 
OK - you don't need a separate table to house the additional values - but if you have lots, then it may be easier!

In the UNION part, you have to fool it into adding in the extra data you want.... and as part of that fooling process, you have to tell it where it should be getting the data from.... even though it isn't, iyswim?

If you wanted to add in more than one additional option, then you just UNION for each one... eg

SELECT yourfield
FROM yourtable WHERE yourcriteria
UNION SELECT "Option 1"
FROM yourtable

UNION SELECT "Option 2"
FROM yourtable

UNION SELECT "Option 3"
FROM yourtable

ORDERBY yourfield;

If you were doing it from two tables:

SELECT yourfield
FROM yourtable WHERE yourcriteria
UNION SELECT yourfield
FROM your2ndtable

ORDERBY yourfield;

not sure if that makes things any clearer?
 
Thanks - I get it now :-)

Thought you had misunderstood the question, I had just misunderstood the answer! Appreciate your help :D
 

Users who are viewing this thread

Back
Top Bottom