Filter Combobox with Value List Type

shafara7

Registered User.
Local time
Today, 21:32
Joined
May 8, 2017
Messages
118
Hi, I know I have posted something similar before this (link below) but this time it is quite different.

https://www.access-programmers.co.uk/forums/showthread.php?t=293754&highlight=list+filter

In this new case, I have a combobox with value list type and an option button that will filter the value inside the combobox.
For example, my cboCountry has the following value:
1; China; 2; Belgium; 3; Italy; 4; India; 5; Spain; 6; Portugal...
And my option button named optAsia will filter the countries to only Asian country when it's checked.
I want it to only show:
1; China; 4; India
when the optAsia in checked.

Is there any VBA code for this to make it possible?
 
Create a table with country & continent as fields then use that for your record source for each item
 
I know that if the combobox is a Table/Query type.
But mine is Value List type.
 
I realise that. You'll have to change it.

I'm sure Access doesn't happen to know which continent every country is in!
 
I was thinking of a code that will only show the value that we want
such as cboCountry.value = 1, 4 ... (for example) but I am not sure if such codes exist.

I thought about that option group too. I am mot sure how it will group together the records. So maybe I should just change to combobox instead on option group.

But whether or not I use the option group or combobox, I still have to look for the vba codes like the example above.
 
It is reasonable to expect Access to understand data that won't change e.g. calendar dates

However countries do change and so any list (if it does exist) won't remain the same over time.
For that reason, its not going to be built into Access.
Also some countries are in more than one continent e.g. Turkey is in both Europe & Asia so would need 2 records.

You may be able to download a list of countries & continents if you search the net.
No matter whether you use an option group or combo box (better) for continents you will still need to store the data in a table
 

Users who are viewing this thread

Back
Top Bottom