I have a dependant combo box on one of my forms that works fine when a record is loaded directly.
However when using the next/back controls at the bottom of the form to move to the next record it does not correctly load the value for the dependant combo box and it is just shown as being blank and with the dependant combo box options for the previous record.
If I click on the first combo box and re-select the option that is already showing then the correct dependant value will show in the dependant combo box.
I'll give an example to make it clearer:
Combo Box 1 (CB1) possible values:
a (a1, a2, a3)
b (b1, b2, b3)
c (c1, c2, c3)
Combo box 2 (CB2) values are shown in the brackets above.
Record 1:
CB1 = a
CB2 = a2
Record 2:
CB1 = b
CB2 = b3
If currently on record 1 and then click next to go to record 2 CB2 would have the possible values (a1, a2, a3), the same as record one and combo boxes on record 2 would show:
CB1 - b
CB2 - blank
If CB1 is then clicked on and value 'b' reselected then CB2 will correctly show value 'b3'.
Sorry the description is little long winded, but I hope I have made myself clear.
I have tried adding CB2.ReQuery command to 'On Open' and 'On Load' events but that has not solved the problem.
Does anyone know why this behaviour is happening and how can I get it to work correctly?
However when using the next/back controls at the bottom of the form to move to the next record it does not correctly load the value for the dependant combo box and it is just shown as being blank and with the dependant combo box options for the previous record.
If I click on the first combo box and re-select the option that is already showing then the correct dependant value will show in the dependant combo box.
I'll give an example to make it clearer:
Combo Box 1 (CB1) possible values:
a (a1, a2, a3)
b (b1, b2, b3)
c (c1, c2, c3)
Combo box 2 (CB2) values are shown in the brackets above.
Record 1:
CB1 = a
CB2 = a2
Record 2:
CB1 = b
CB2 = b3
If currently on record 1 and then click next to go to record 2 CB2 would have the possible values (a1, a2, a3), the same as record one and combo boxes on record 2 would show:
CB1 - b
CB2 - blank
If CB1 is then clicked on and value 'b' reselected then CB2 will correctly show value 'b3'.
Sorry the description is little long winded, but I hope I have made myself clear.
I have tried adding CB2.ReQuery command to 'On Open' and 'On Load' events but that has not solved the problem.
Does anyone know why this behaviour is happening and how can I get it to work correctly?