simon551
IS-IT--Management
- May 4, 2005
- 249
Hello,
I have a combo box on a subform that references a combo box on the main form in a query. The query works beautifully on it's own, but when I drop it in the combo, the sql gets mucked up for some reason and I get a syntax error in From Clause.
This is the original sql:
SELECT tblBillingCodeItems.BillingCodeItemID, tblBillingCodeItems.WorkDesc
FROM tblBillingCodeItems INNER JOIN ((SELECT tblEmployees.EmpID, tblGroups.GroupID
FROM tblGroups INNER JOIN tblEmployees ON tblGroups.GroupID = tblEmployees.DeptID
WHERE (((tblEmployees.EmpID)=[Forms]![frmTimesheet_ListViewMain]![EmpID]))) AS G)
ON tblBillingCodeItems.GroupID = G.GroupID;
This is after being changed. I've tried this over and over and have the same problem.
SELECT tblBillingCodeItems.BillingCodeItemID, tblBillingCodeItems.WorkDesc FROM tblBillingCodeItems INNER JOIN [SELECT tblEmployees].[EmpID, tblGroups].[GroupID FROM tblGroups INNER JOIN tblEmployees ON tblGroups].[GroupID = tblEmployees].[DeptID WHERE (((tblEmployees].[EmpID)=[Forms]]![frmTimesheet_ListViewMain]![[EmpID]))] AS G ON tblBillingCodeItems.GroupID=G.GroupID;
Any idea how to fix this bug? Thanks in advance!
I have a combo box on a subform that references a combo box on the main form in a query. The query works beautifully on it's own, but when I drop it in the combo, the sql gets mucked up for some reason and I get a syntax error in From Clause.
This is the original sql:
SELECT tblBillingCodeItems.BillingCodeItemID, tblBillingCodeItems.WorkDesc
FROM tblBillingCodeItems INNER JOIN ((SELECT tblEmployees.EmpID, tblGroups.GroupID
FROM tblGroups INNER JOIN tblEmployees ON tblGroups.GroupID = tblEmployees.DeptID
WHERE (((tblEmployees.EmpID)=[Forms]![frmTimesheet_ListViewMain]![EmpID]))) AS G)
ON tblBillingCodeItems.GroupID = G.GroupID;
This is after being changed. I've tried this over and over and have the same problem.
SELECT tblBillingCodeItems.BillingCodeItemID, tblBillingCodeItems.WorkDesc FROM tblBillingCodeItems INNER JOIN [SELECT tblEmployees].[EmpID, tblGroups].[GroupID FROM tblGroups INNER JOIN tblEmployees ON tblGroups].[GroupID = tblEmployees].[DeptID WHERE (((tblEmployees].[EmpID)=[Forms]]![frmTimesheet_ListViewMain]![[EmpID]))] AS G ON tblBillingCodeItems.GroupID=G.GroupID;
Any idea how to fix this bug? Thanks in advance!