Limiting selections in a drop down

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have a dropdown in form1 that is controlled by column1 in table1. Column3
in table1 groups each record into groups of 1, 2, 3, etc, with multiple
records belonging to multiple groups. Is there a way to have the dropdown
limit what it shows to only group 1, or group 2, or group 3... etc. I
thought I could use a SELECT column1 WHERE column3 = 1 or something similar,
but I could not get it to work.
Any ideas? Thanks!
 
Gary

You and I may not mean the same thing by "is controlled by ...".

I'm not sure I understand "with multiple records belonging to multiple
groups".

Can you create a query that returns only the Group1 items? If so, you can
use that (query) as a row source for your combo box.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Thanks Jeff!
"is controlled by" means the control source.
Sorry for the lack of information -
"with multiple records belonging to multiple groups" means records 1, 2, 6,
9, 12, 23 (random ones in table1) all belong to group 1 (1 is the value in
field3), where 3, 4, 5, 7, 8, 17 belong to group 2 (2 is the value in
field3), and 10, 11, 13, 14 belong to group 3 (3 is the value in field3)
I would like to eliminate groups 2 and 3 from appearing in the drop down and
only have group 1 appear (other situations would have only group 2 appear,
and other only group 3, and so on...)

Thanks for the answer, I used the following query SQL in the row source and
got it to work!
SELECT Table1.field1, Table1.field3 FROM Table1 WHERE (((Table1.field3)=1));
-gary
 
Hi Jeff,

While the solution you provided worked and limited the drop down selections
to the appropriate group, I am having trouble actually selected the option,
in fact, nothing is happening, and it defaults back to the original
selection, regardless of what I select. Any thoughts?

Thanks again!
-gary
 
Hi Jeff,
Yes, the box is bound to field1 from table1. Original selection meant
record #1 from table1, from group 1.
I figured it out, I needed to bring in field2 into the code for the "row
source" so it now reads:
SELECT Table1.field1, Table1.field2, Table1.field3 FROM Table1 WHERE
(((Table1.field3)=1));
Thank you so much for all your help!
-gary
 
Back
Top