
This Access VBA tutorial explains how to change Query criteria in VBA using QueryDef.SQL Property.
You may also want to read:
Create Query using CreateQueryDef
Access VBA - change Query criteria
It is easy to change Query criteria in Query View, but sometimes your criteria may depend on a variable that is not a constant. In Access VBA, you can change the Query criteria using QueryDef.SQL Property. In fact, QueryDef.SQL does not really update just the update the criteria of the statement,...
Read More