LookupComboBox

I have a TADOTable linked to animals.mdb file, the animal.mdb file has 2 fields, KindOfAnimal and Breed.

The Dataset is linked to the TDatasource.

I also have 2 TDBLookupComboBoxes, the first has the keyfield and Listfield set to AnimalKind and the second has the Keyfield and Listfield set to Breed.

What I am trying achieve is this, depending on what I select in the first LookupComboBox determines the list in the second LookupComboBox.

The animal.mdb records is something like this

KindOfAnimal Breed
Dog Poodle
Cat Siamese
Dog Boxer
Bird Canary
Cat Persian
Dog Labrador
Bird African Grey
Cat Domestic Short Haired (DSH)
Dog Great Dane

If I select 'Dog' on the first LookupComboBox then the second LookupComboBox should only show the records in the Breed field that is associated with 'Dog' in the first field.

So selecting ‘Dog’ should only show the following in the second LookupComboBox;
Poodle
Boxer
Labrador
Great Dane

Likewise selecting ‘Cat’ should only show;
Siamese
Persian
Domestic Short Haired (DSH)

etc, etc;

Any help would be greatly appreciated.

Regards
Steve

Comments

Sign In or Register to comment.