Lets say I have a table:
Where "petID" is ofcourse the pk, "name" is the name of the breed, and "type" is the species of the pet(dog or cat). There is also another table - "Cages" - with two fields - "cageID" as the pk, and "pet" which is linked to "Pets.petID".
Now, I've made a continuous form for "Cages". The form contains a textbox for "cageID", and a combobox for "pet" - which takes it's values from "Pets". So far, quite simple:
Now, the problem begins when I want to filter the dropdown list of the combobox - lets say to contain just dogs. so I change it's rowsource:
This is what I get when I run that code:
All the cats are gone! I know I filtered them out, but I did this because I want easier access to the dogs in the dropdown list - I still want cages that contain cats to display the cat breed!
So, is there a way to solve this? To filter out rows from the dropdown list, yes still have them displayed if they are selected?
If it isn't possible, I thought of a few workarounds for this:
Thanks in advance!

Where "petID" is ofcourse the pk, "name" is the name of the breed, and "type" is the species of the pet(dog or cat). There is also another table - "Cages" - with two fields - "cageID" as the pk, and "pet" which is linked to "Pets.petID".
Now, I've made a continuous form for "Cages". The form contains a textbox for "cageID", and a combobox for "pet" - which takes it's values from "Pets". So far, quite simple:

Now, the problem begins when I want to filter the dropdown list of the combobox - lets say to contain just dogs. so I change it's rowsource:
Code:
cbo_pet.RowSource = "SELECT Pets.petID, Pets.name FROM Pets WHERE Pets.type='dog'"
cbo_pet.Requery

All the cats are gone! I know I filtered them out, but I did this because I want easier access to the dogs in the dropdown list - I still want cages that contain cats to display the cat breed!
So, is there a way to solve this? To filter out rows from the dropdown list, yes still have them displayed if they are selected?
If it isn't possible, I thought of a few workarounds for this:
- Sort instead of filter. I just sort it so all the dogs will be on the top of the list, so the user can easily access them. I think it's a BAD solution, but I decided to write it just in case... maybe there is a way to cut the dropdown list in the middle?
- Cover the combobox with a textbox. I create a textbox with the name of the breed, and locate it over the combobox so only the dropdown button is visible. The only problem in this solution is that it forces the user to use the dropdown list - they can't just write inside the combobox and have Access autocomplete it for him... however, they can use the autocomplete method of inserting values if they click the dropdown button first and then start typing the name of the breed.
- Add an extra row the dropdown list of each combobox, containing the value already in there. That way, even if it's in a group that's supposed to be filtered out, it will still be in the list, and will be displayed.
Problem is - I'm using a continuous form, so if I change the RowSource of one combobox - it changes the RowSource of them all. Is there a way to access that property individually? I've tried googling it out, but all I can find is stuff about conditional formatting...
Thanks in advance!