I've been looking for a solution for this problem everywhere but to no avail. I have a table with a list of values that I need to use as search criteria for a query. More specifically, this table contains two columns of values: 1) the name of the table where the query should search and 2) the field that the query should search for. Let me give a simplified example:
The table of values:
TableName | FieldName
-----------------------
Fruits | Apples
Fruits | Bananas
Fruits | Oranges
Vegetables | Mushrooms
Vegetables | Carrots
So the list would be passed five times through the query to produce 5 different results. For instance, the query would be pointed to the 'Fruits' table to count the number of instances of 'Apples', as would be the case for each row.
How do I do this? And how do I write the query so that the table values will essentially act as variables? Do I need to use VBA?
I'm a bit of an Access noob, so any help would be appreciated - especially since I've been doing this manually. It's taking a lifetime.
The table of values:
TableName | FieldName
-----------------------
Fruits | Apples
Fruits | Bananas
Fruits | Oranges
Vegetables | Mushrooms
Vegetables | Carrots
So the list would be passed five times through the query to produce 5 different results. For instance, the query would be pointed to the 'Fruits' table to count the number of instances of 'Apples', as would be the case for each row.
How do I do this? And how do I write the query so that the table values will essentially act as variables? Do I need to use VBA?
I'm a bit of an Access noob, so any help would be appreciated - especially since I've been doing this manually. It's taking a lifetime.