Cascading combo boxes - are they able to do this?

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I would like to set up a form containing a combo box with a list of
mechanisms of injury. Some mechanisms have sub groups that I would like to
have visible by means of linking them with a cascading combo box. Is it
possible to have only some records from Cbo 1 link to Cbo 2? The examples I
have seen to date show cascading data for all records in the first combo ie
the city/state or postcode/suburb examples where every record has a sub
record.

Thanks for your help.
 
Joe,
If I understand correctly, you initially show just the first combo
(ex. cboInjury), and on the AfterUpdate of cboInjury, if the selected
value has an associated SubInjury choice/choices... then make make
cboSubInjury visible and updateable.
You'd also have to add the same determination code to the record's
OnCurrent event, so cboSubInjury would show/not show according to the
cboInjury value.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
You'd also have to add the same determination code to the record's
OnCurrent event, so cboSubInjury would show/not show according to the
cboInjury value.
Why not have a field in combo1's source table to indicate sub or not -
Yes/No field.
 
Karl,
I had in mind two colums in cbo1...
Injury SubInjury

AfterUpdate... is cbo1.Column(1) = Null then...

OnCurrent... is cbo1.Column(1) = Null then...

If I understand you correctly... seems as though a T/F in cbo1 would be
pretty much the same thing.
Mine is just one of many possible "flavors" of a solution.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Karl,
I had in mind two colums in cbo1...
Injury SubInjury

AfterUpdate... is cbo1.Column(1) = Null then...

OnCurrent... is cbo1.Column(1) = Null then...

One correction: Nothing - not even another NULL - is ever equal to NULL. These
comparisons will fail regardless of what's in Column(1). The correct syntax is

If IsNull(cbo1.Column(1)) Then...
 
John,
That was just aircode...
It was just an interpretation/representation of the logic.
Please... I would never actually code it like that...
Al
 
John,
That was just aircode...
It was just an interpretation/representation of the logic.
Please... I would never actually code it like that...
Al

I didn't think so... just wanted to warn the lurkers! "Even Jove nods..."
 
Back
Top