T
Tatakau
I have a table that describes different tour promotions at a resort. The
primary key is made up of a Keycode and a Promocode. Other columns include
Source, Program, and Company, Price, and Premium.
I am trying to make a form that uses two combo boxes to choose the primary
key, and then auto fill the remaining fields (for viewing - not for editing).
I am trying to make the first combo box select all unique values of column
Keycode, and then the second combo box only allow selection of unique values
of column Promo that are associated with the keycode.
A long-winded example is below... I really apprecate any help I could get on
this!
Thanks in advance!
Nick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EG (referring to the table below)
When the form opens, combo1 can select one of the many unique values from
Keycode. No values are showed more than once (such as BBACK or HMV). Combo2
remains empty until a value is selected.
If a keycode that only appears once in the table is selected (eg., 150/100,
BG, or REX), combo2 will automatically fill in the correct value. All
remaining fields will be filled in automatically.
If a keycode that appears multiple times in the table is selected (eg.,
BBACK or HMV), combo2 should remain null, but the combo box should drop down
to offer only the values that appear with the corresponding keycodes. EG.,
if BBACK is selected for combo1, combo2 should have options '35' and '36'.
If HMV is selected, combo2 should have options '33', '34', '39', and '40'.
Once the second combo box is selected, all remaining fields will be filled in
automatically.
Sample data from the table:
Keycode | Promo | Source | Program | Company | Price | Premium
150/100 20 31 53 53 200G
BBACK 35 84 24 21 $119 100G
BBACK 36 84 24 21 $169 100G
BG 8 2 41 41
HMV 33 2 19 16 $89 50G
HMV 34 2 19 16 $119 50G
HMV 39 2 19 16 $169 100G
HMV 40 2 19 16 $169 100G
REX 20 14 10 10
primary key is made up of a Keycode and a Promocode. Other columns include
Source, Program, and Company, Price, and Premium.
I am trying to make a form that uses two combo boxes to choose the primary
key, and then auto fill the remaining fields (for viewing - not for editing).
I am trying to make the first combo box select all unique values of column
Keycode, and then the second combo box only allow selection of unique values
of column Promo that are associated with the keycode.
A long-winded example is below... I really apprecate any help I could get on
this!
Thanks in advance!
Nick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EG (referring to the table below)
When the form opens, combo1 can select one of the many unique values from
Keycode. No values are showed more than once (such as BBACK or HMV). Combo2
remains empty until a value is selected.
If a keycode that only appears once in the table is selected (eg., 150/100,
BG, or REX), combo2 will automatically fill in the correct value. All
remaining fields will be filled in automatically.
If a keycode that appears multiple times in the table is selected (eg.,
BBACK or HMV), combo2 should remain null, but the combo box should drop down
to offer only the values that appear with the corresponding keycodes. EG.,
if BBACK is selected for combo1, combo2 should have options '35' and '36'.
If HMV is selected, combo2 should have options '33', '34', '39', and '40'.
Once the second combo box is selected, all remaining fields will be filled in
automatically.
Sample data from the table:
Keycode | Promo | Source | Program | Company | Price | Premium
150/100 20 31 53 53 200G
BBACK 35 84 24 21 $119 100G
BBACK 36 84 24 21 $169 100G
BG 8 2 41 41
HMV 33 2 19 16 $89 50G
HMV 34 2 19 16 $119 50G
HMV 39 2 19 16 $169 100G
HMV 40 2 19 16 $169 100G
REX 20 14 10 10