Connecting Tech Pros Worldwide Help | Site Map

Linked Listboxes

Dale Walker
Guest
 
Posts: n/a
#1: Nov 13 '05
Lets say I've got a table that may looks a bit like this....

ID Name Log
-----------------
01 Fred Went Bowling
02 Wilma Hit Fred over the head with a club
03 Fred Says Ouch!
04 Barney Mows Freds Lawn with a baby triceratops
05 Betty Goes shopping
06 Spock Does that Vulcan nervepinch thing
07 Kirk Gets in a fist fight and then kisses the girl
08 Spock Does a mindmeld on McCoy
09 Fred Yells 'Yabba dabba do'

Is it possible to create two listboxes so that the first would be a
DISTINCT version of the name and the second would contain all the
insances of that name?

e.g

Listbox 1
*Fred* <Selected>
Wilma
Barney
Betty
Spock
Kirk

Listbox 2
Went Bowling
Says Ouch!
Yells 'Yabba Dabba Do'

How do I link the second to the first?

Better still, is there a nested listbox type object with those little
[+] 'expand' icons so the table would appear like the subdatasheet
thing does (only with one table instead of two)?
Chance
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Linked Listboxes


We like to call this "Cascading Combo Boxes".

1. on your form create 2 combo boxes.
2. In top combo box (cbo1) make the recordsource show all names,
grouped. Make sure you bind cbo1 to the column that contains the
linkable data (in this case Name). Hopefully you can link to a primary
key field.
3. In the bottom combo box (cbo2) create the recordset linking to cbo1.
In the criteria for the correct field, right-click and choose "Build".
4. Point to the correct object (cbo1)
5. Run form.
6. Select name in cbo1
7. Press <F9> to refresh cbo2

Let me know if you get this working.

Closed Thread