limit combo box selection from another combobox

scopes456

Registered User.
Local time
Today, 09:37
Joined
Feb 13, 2013
Messages
88
I attached my database to help explain. I have a form with 5 combo box that select dates ( dates come from a dates table and listed in order by ID). I would like when a user selects a date in combo box 1 , combo box 2 - 5 will be limited to the next 4 date ranges.

Example date is arrange by ID

ID Date
1 jan-1
2 jan-2
3 jan-3
4 jan-4
5 jan-5
6 jan-6
7- jan-7

If I select Jan-1 in combo box 1 ( ID #1) the only options I can pick in combo box 2 to 5 will be from Jan-2 to Jan- 5 ( next 4 ID on the list after JAN-1)
 

Attachments

I have made some changes to the SQL statement for cmb2 and added some code to its Got Focus event. If this meets your requirements have a go at making the changes needed to the other combo boxes. Post back if you need further help.
 

Attachments

FYI, the concept involved is called "cascading comboboxes" although the exact same thing applies to Listboxes with the MultiSelect Property set to None, and the code is interchangeable. Here are a couple of links with examples:

Cascading List for Access Forms

Cascading Combo/List Boxes

If you Google the term "Cascading Comboboxes" along with "MS Access" you'll probably get a gazillion hits!

Linq ;0)>
 
bob fitz thank you for showing me how to do this. I was able to put it on the other combo box and works perfect.

missinglinq thank you for telling me the name of the concept I was going after.
 
bob fitz thank you for showing me how to do this. I was able to put it on the other combo box and works perfect.
You're welcome. Glad we could help.
 

Users who are viewing this thread

Back
Top Bottom