Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit Combo Box List

Status
Not open for further replies.

kcmark

Technical User
Nov 2, 2002
63
US
I have a form where a user has to select 3 unique items (from a list of about 12 items). I am using 3 combo boxes to capture the 3 selections. I can get the drop-down list to populate correctly from a query I built. However, I would like to limit the list to only the items that have not been selected. In other words, once a user selects an item it is no longer available as an option for the other 2 combo boxes. Any ideas on how to accomplish this?
 
I added this code to the row source line. SR1, SR2 and SR3 are the combo boxes used to capture the selection.

SELECT SRQ.Rep_Name FROM SRQ WHERE SRQ.Rep_Name<>SR2 And SRQ.Rep_Name<>SR3

The entire list is being populated to the combo list, but it is not getting updated when a selection is being made (the entire list shows for all 3 combo boxes).

 
In the After_Update event of all three combo boxes, try requerying the other 2.

Soin the After_Update event of SR1, say:

Me.SR2.Requery
Me.SR3.Requery

Do the same for the other combo boxes.

The objective might be better accomplished using a multi-valued list box.

-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top