Filtering field in 2nd subform based on selection in 1st subform

sburgess

Registered User.
Local time
Today, 03:53
Joined
Mar 16, 2006
Messages
13
I almost have this form done.

I have a form with a combo box, and 2 subforms from it. When you select in the combo box (Group), it brings up the choices (Sections) for that group in a subform. Then there is another subform, that is supposed to bring up a series of questions that are related to the section that has been selected. The question field has a drop down to a list table, that has all the questions. Once the question has been selected, it stores in a Master table. The relationship is there. If you try to select any questions that do not pertain to the section, it gives you an error message.

What I need it to do, is when the section is selected, filter out the questions that pertain to that section, and have those questions be the only ones available in the drop-down list to choose.

I know that I need to have an After Update code once the section has been selected, but not sure how the coding should be.

I hope that someone can help with this!

:confused:
 
I hope I'm understanding you correctly... when I do this kind of thing, I base the subform contents on an underlying query with criteria from the main form, or in your case, the first subform. I would assign a code to each of the Sections you mention in the first form, and then using the same "schedule of codes" apply them to the questions also. For example, Section 0001, go to the list of questions and code only the ones that apply to that section with the same code, 0001. Then using the AfterUpdate property on Subform1, whenever that value in Subform1 is changed, the second subform gets freshened but constrained with only those questions with a relational value of 0001. That constraint is actually criteria from the underlying query for Subform2.

Hope that helps-
 

Users who are viewing this thread

Back
Top Bottom