Modifying a Cascading Combo

J

JohnB

Hi.

With help from this Discussion Group, I have built a cascading combo setup
using cboSchools and cboMentors. This works fine but I wondered if it could
be modified to work in a slightly different way.

At present, cboSchools is used first and this causes cboMentors to show a
filtered set of Mentors in its dropdown, relevant to that school. Both combos
are in a subform. Could this be changed so that the filtering action is
triggered by the user 'opening' cboMentors i.e. by them clicking on the
little down arrow?

This would have the benefit that, at any time, the cboMentors dropdown list
would show the mentors relevant to the school shown in cboSchool in the same
record, rather than showing Mentors for the school that was last selected in
cboSchools - which could have been in a completely different subform record.

Can this be done? Thanks, JohnB
 
R

Roger Carlson

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "CascadingCombos.mdb". In it are two examples of doing what
you want. They are "A More Complex Combo Example" and "Complex Example
Using All". In both of these, if the first combo has a "*" or "All"
(respectively) then the second combo shows all records. Once you select a
value in the second combo, the corresponding value in the first combo
appears. From that point, only relevant value appear in the second combo
until the "All" value is selected again in the first.

Take a look at the sample and it should be clearer.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
J

JohnB

Hi again Roger.

I've had a look at your sample mdb - an excellent way to show relative
novices a new way to do things. I'm hope I'll use the sample techniques at
some point in the future but they don't exactly match what I was thinking
about for now.

In fact, I've now realised that my question is very similer to one I posted
a while ago, albeit for a different reason. The question hinges on whether or
not it's possible to have an Event run when the User clicks on the down arrow
in a combo box. If it is possible, then the code that makes cboMentor filter
its record source dependant on cboSchools could run when cboMentors is
"opened', rather than when a School is chosen in cboSchools. Do you see what
I mean? The reaponse to my earlier post was effectively "no, there is no
direct event that runs when the user opens a combo box"

Any further ideas? Anyway, thanks again for the sample mdb. JohnB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top