cascading 3 combo boxes on 1form and 2 subforms (1 Viewer)

atol

Registered User.
Local time
Today, 01:02
Joined
Aug 31, 2007
Messages
64
Hi there,
I will appreciate if someone help me with the following.
I have three nested forms that is Form3 is withing Form2 that is within Form1 (in reality = 1 Form and 2 subforms cascaded).
I want to select a value from Combo1, that will further brings the values in Form2, and then further filter the values in Form3. If the three combos were on the same form, I wouldn't have an issue. But since each combo is in every cascading form/subform, I dont know how to pass the filterning further to the other two combos.
Not sure if I explained well, but if anyone can assist, that would be really helpful.
Rgds,
Atol
 

Mihail

Registered User.
Local time
Today, 11:02
Joined
Jan 22, 2011
Messages
2,373
I understand this:
1) You select something in Combo1 that is in Form1.
2) The Combo2 (from Form2) should be filtered.
3) You select something in Combo2
4 The Combo3 (from Form3) should be filtered.

Is this your environment / question ?
 

atol

Registered User.
Local time
Today, 01:02
Joined
Aug 31, 2007
Messages
64
hey Mihail. You are correct. That is the case I am trying to solve. Will appreciate if you could assist,
Rgds
Atol
 

Mihail

Registered User.
Local time
Today, 11:02
Joined
Jan 22, 2011
Messages
2,373
In Form2 module create a public sub
Code:
Public Sub RequeryCombo2()
  Me.Combo2.Requery
End Sub
Do the same in Form3
Code:
Public Sub RequeryCombo3()
  Me.Combo3.Requery
End Sub
In Form1 use the Click event for Combo1
Code:
Private Sub Combo1_Click()
  Call Form2.RequeryCombo2
End Sub
Do the same in Form2
Code:
Private Sub Combo2_Click()
  Call Form3.RequeryCombo3
End Sub
In the Combo2 query you should have, in criteria row:
Forms!Form1.Combo1

In the Combo3 query you should have, in criteria row:
Forms!Form2.Combo2

Hope I am not missing something.

Good luck !
 

atol

Registered User.
Local time
Today, 01:02
Joined
Aug 31, 2007
Messages
64
This is awesome. Thanks Mihail.
If i have situation where
1) I select something in Combo1 that is in Form1.
2) The Combo3 (from Form3) should be filtered.

Pretty much the cascading going from Form1 to Form 3 directly.

Would anything change to the code above?

Thanks again!
 

Mihail

Registered User.
Local time
Today, 11:02
Joined
Jan 22, 2011
Messages
2,373
Of course.
Think a bit:

Now, your Form1 is still Form1
But Form3 become Form2 (regarding to my code) isn't it ?
 

atol

Registered User.
Local time
Today, 01:02
Joined
Aug 31, 2007
Messages
64
cool cool..yep, makes sense....thanks a lot man.. much appreciated....
 

Users who are viewing this thread

Top Bottom