Using one combo box to set another combobox

R

RICHARD BROMBERG

I have a table called PHONE with fields ID,CATEGORY, and NAME as well as
some other fields.



I have a combobox named CmboSelectCategory

With this row source SELECT [phone].[ID], [phone].[CATEGORY]
FROM phone;



I have a second combobox named CmboSelectName

With this row source SELECT [phone].[CATEGORY],
[phone].[NAME] FROM phone WHERE ((([phone].[CATEGORY])="abc"));



In the second combobox I want to replace the term "abc" with the selection
made by the first combobox.



I used the term "abc" to test the second combobox and it does select all
records where the category is abc.
 
D

Douglas J. Steele

SELECT [CATEGORY], [NAME]
FROM phone
WHERE [CATEGORY] = Forms!NameOfForm!CmboSelectCategory
 
A

Al Campagna

Richard,
Why have PhoneID in the first column of cmboSelectCategory, when you really want the
Category to be used to filter combo2?
Normally, combo1 should be... Category in col 1 and ID in col2
Your combo1 appears to contain the PhoneID.

I'll work with your setup for now, where cmboSelectCategory's value is really the
PhoneID.

You can still refer to the Category value in cmboSelectCategory in the query for
cmboSelectName
In the query behind the second combo, your Category field should have a criteria of...
(Use your own object names)
=Forms!YourFormName!cmboSelectCategory.Column(1)
(combo box colums are numbered left to right... 0, 1, 2, 3, etc...)

Form what you've described... Category in cmboSelectCategory is actually in Col (1)...
not Col (0)

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

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