R
Richard G. Harper
I found Q209595 (How to Synchronize Two Combo Boxes on a Form) and
understand the basic concept but I need to extend it just a little more and
am having problems wrapping my brain around the solution.
Say we have two tables - Table1 is auto-numbered and contains a list of
items a user can select from using ComboBox1. Table2 contains many items
that may apply to more than one item from Table1, something like this:
WARNING1 - applies to item 1 in Table1
WARNING2 - applies to items 1 and 2 in Table1
WARNING3 - applies to item 3 in Table1
WARNING4 - applies to items 1, 2 and 3 in Table1
WARNING5 - applies to items 1 and 3 in Table1
and so on.
What I want to do is set up Table2/ComboBox2 so that when the user makes a
selection in ComboBox1, only those items from Table2 that apply to their
ComboBox1 selection would then appear in ComboBox2.
If I were doing this in VisualBASIC I'd set up Table2 like this:
WARNING1 1
WARNING2 12
WARNING3 3
WARNING4 123
WARNING5 13
and use InStr to search Table2 for matches, populating ComboBox2 with those
that do match ... but this seems rather kludgy to me and it feels like there
should be a more elegant method of doing this. I've googled the subject but
I'm either choosing bad keywords or no one else has tried to do this
before.
Thanks in advance for your consideration.
understand the basic concept but I need to extend it just a little more and
am having problems wrapping my brain around the solution.
Say we have two tables - Table1 is auto-numbered and contains a list of
items a user can select from using ComboBox1. Table2 contains many items
that may apply to more than one item from Table1, something like this:
WARNING1 - applies to item 1 in Table1
WARNING2 - applies to items 1 and 2 in Table1
WARNING3 - applies to item 3 in Table1
WARNING4 - applies to items 1, 2 and 3 in Table1
WARNING5 - applies to items 1 and 3 in Table1
and so on.
What I want to do is set up Table2/ComboBox2 so that when the user makes a
selection in ComboBox1, only those items from Table2 that apply to their
ComboBox1 selection would then appear in ComboBox2.
If I were doing this in VisualBASIC I'd set up Table2 like this:
WARNING1 1
WARNING2 12
WARNING3 3
WARNING4 123
WARNING5 13
and use InStr to search Table2 for matches, populating ComboBox2 with those
that do match ... but this seems rather kludgy to me and it feels like there
should be a more elegant method of doing this. I've googled the subject but
I'm either choosing bad keywords or no one else has tried to do this
before.
Thanks in advance for your consideration.