Single value for Control Source

S

Stu

I have a combo box for which I want the control source to be a single value
in a table that has several rows and columns, like DLookup works. What would
the control source look like?
 
K

Klatuu

Sorry, Stu, but I can't figure out what it is you want to do. What does "a
single value in a table that has several rows and columns" mean?
This is what makes no sense.
 
S

Stu

I would like the control source to be "select f1 from t1 where t1.f2 =
"Something" and "Something" is a unique value. f1 then can take on values
such as A, B or C.
 
K

Klatuu

If your control source is select f1 from t1 where t1.f2 = "Something" then
you will get all rows in t1 that have a value of "Something" in f1. There
will be no A B or C.

Can you describe What you are trying to do, rather than How, Please?
 
S

Stu

Sorry but I don't understand your response. I thought I was posting the What
and my question is How....can I have a control source of a value (row, column
combination) in a table rather than a column row source. I've given examples
of how a SQL select statement and DLOOKUP are capable of returning a single
value in a row of a table as example of WHAT I'm looking to do; HOW can I get
that capability in the row source? Can I user the row source as
'=DLOOKUP("f1","T1","reference = 'G2'"). I doubt that will work but it
describes WHAT I'm looking for.
 
K

Klatuu

What is the business rule
How is the technical solution.
So.

=DLOOKUP("f1","T1","reference = 'G2'")
Will return the value in the field f1 of table T1 in the first record that
has the field reference = to G2. Okay, fine. Now all combo row sources
return rows. But if you are asking how to return a list of values in f1 that
have a value of 'G2' in the field reference, then it would be:

SELECT f1 FROM T1 WHERE reference = "G2";

I really hope this is your answer. If not, please define the business rule
and I will help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top