'Can Access Query Builder use a dynamic form name as criteria for drop-down list?
I have a simple query as a Row Source for a combo box. It returns a list of Departments associated to a Customer. The returned values are used to populate a drop-down list on a form (Workorders by Customer) for the end-user to select from.
I now need to add a new form that will have the same type of department-selection functionality.
The code in Query Builder has a hard-coded reference to the original form in the criteria. (Workorders by Customer)
I would like to now re-use this query for the new form's drop-down list.
Is there a way to turn the form-name criteria into something dynamic so it gets the name of the calling form instead of hard-coding the calling form's name? Like something similar to VBA's usage of "Me."?
I've tried Me.[CustID] in the Query Builder criteria but it didn't work.
Thank you in advance for any assistance!
SELECT tblDepartments.ID, tblDepartments.CustID, tblDepartments.DeptName
FROM tblDepartments
WHERE (((tblDepartments.CustID)=[Forms]![Workorders by Customer]![CustID]))
ORDER BY tblDepartments.DeptName;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
