Access query criteria does not filter if record source is via combo box (1 Viewer)

Ihk

Member
Local time
Today, 07:22
Joined
Apr 7, 2020
Messages
280
Hi, I have lot of fields in table1, Some of them are combobox source from another table2.
Query is made from table1. Now I want to filter records, successfully filters records which are not comboboxes.
For example:
Table contains field of countries, each country is repeated many times. In query design view > under criteria "France" > then all records are filtered.
But If the same is via combobox field and I do the same > under query criteria > "France" it deos not filter, rather result appears as empty.
What can be the reason? suggestions please. Thanks
1625264403072.png
Those field which are not sourced via combo, are filtered perfectly.
NOTE: if I remove this filter from combo field, all record appear perfectly, meaning query shows all records, but only does not filter or show blank record, when filter in combo field.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:22
Joined
Aug 30, 2003
Messages
36,118
If I had to guess, the bound column of your combo is an ID field, not the text "France".
 

Ihk

Member
Local time
Today, 07:22
Joined
Apr 7, 2020
Messages
280
If I had to guess, the bound column of your combo is an ID field, not the text "France".
Oh yes, you are 100% right..... after your reply, I tested this by puting the ID number of France. and it worked it filtered France.
Now question is how can I change this.
This problem I could not solve earlier as well. Meaning now apparently "France" is shown up in field, but actually as you said it is ID and I checked.
How to rectify this type of issue now and for future as well?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:22
Joined
Aug 30, 2003
Messages
36,118
Presuming countries is a lookup table, your query could join to that table and return the text field. Then you'd be able to type in "France", though most of us would use a form to filter anyway.
 
  • Like
Reactions: Ihk

Ihk

Member
Local time
Today, 07:22
Joined
Apr 7, 2020
Messages
280
Sounds like you have lookup fields:

Presuming countries is a lookup table, your query could join to that table and return the text field. Then you'd be able to type in "France", though most of us would use a form to filter anyway.
I also use form to filter (record source, Select, where)... But it did not work either. The real root cause in this case is it ID, Yes it is look up table. Thank you I will try to solve this...
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:22
Joined
Aug 30, 2003
Messages
36,118
Perhaps you can post your effort that doesn't work? ID fields are pretty commonly used and shouldn't prevent you from doing what you want.
 

Ihk

Member
Local time
Today, 07:22
Joined
Apr 7, 2020
Messages
280
Perhaps you can post your effort that doesn't work? ID fields are pretty commonly used and shouldn't prevent you from doing what you want.
Thank you very much for giving me idea and suggestions, Now it is sorted out and working.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:22
Joined
Aug 30, 2003
Messages
36,118
Happy to help.
 

Users who are viewing this thread

Top Bottom