The IN () condition is a way to go I think. But there are 2 ways to do it.
1. When you can create a subquery, which returns all values you need, the syntax will be
Code:
SELECT ... FROM YourTable1 WHERE ConditionField IN (Select ConditionValue FROM YourTable2 WHERE ...)
, and you can simply run the query, or you call it from some procedure or control event;
2. When you can run a procedure, which returns a comma-separated string of all condition values you need, the code will be something like
Code:
...
Dim QueryString AS String
Dim ConditionList AS String
Dim AllConditonsFound AS Boolean
ConditionList = ""
AllConditionsFound = FALSE
While Not AllConditionsFound
ConditionList = ConditionList & Iif(ConditionList = "", "", ",") & NextConditionExpression
AllConditionsFound = ConditionCheckExpression
WEnd
QueryString = "SELECT ... FROM YourTable1 WHERE ConditionField IN (" & ConditionList & ")"
Using QueryString: Run the query/Run a report with query as source/Update form's Record Source/Do whatever
...