How to limit combo box list based on value in another combo box?

How to limit combo box list based on value in another combo box?

Post by UGF0IERvb2 » Tue, 10 May 2005 06:45:01


Hello,

I have a combo-box (#1) that looks up to a lookup table that contains a
series of Adverse Event categories. I want a second combo box that will only
show the Adverse Events themselves based on the Category chosen in Combo Box
#1. My thought was to have the combo box look up to a query that looks
something like this, but it does not work (see code):

SELECT LU_AETest.AESelect
FROM LU_AETest
WHERE (((LU_AETest.AE)=[Me].[AE]))
ORDER BY LU_AETest.AESelect;

where 'LU_AETest' is the lookup table, 'LU_AETest.AESelect' is the AE value
I'm looking to fill in, 'LU_AETest.AE' is the AE category that I'm looking to
match up to the field 'AE' that I've just filled out on the form. All that
happens when I click on the 'AESelect' combo box is 'Me.AE - Enter Parameter
Value'. Once I fill in the AE Category ('AE'), I would like that value to
limit what the user sees for choices of appropriate AE's ('AESelect'). How
can I do this?

Thanks,
--
Pat Dools
 
 
 

How to limit combo box list based on value in another combo box?

Post by Marshall B » Tue, 10 May 2005 10:30:51


It looks like what you have is fine, except that you can not
use Me in a query (it's strictly a VBA keyword). Change
that part to the full form reference:

WHERE LU_AETest.AE =Forms!yourform.AE

Double check that the AE combo box is really named AE.

--
Marsh
MVP [MS Access]