planetdrouin
Technical User
I have a form which creates Invoices. First the user selects a ClientID on the main form, which then refreshes data in the subform. This part works fine. What I want is for the subform to list out all the Employees names and amount of unbilled time for that client.
What I currently have is a combo box on the subform which lists the employees that meet the main form's criteria. However, the user has to select each name from the combo box individually which then populates the other control boxes on the subform. What I would like is the subform to automatically list out all those that meet the criteria.
The main form has for record source "tblInvoice", while the subform has "tblTimeInvoiced". On the other hand, the combo box on the subform uses a query to filter the EmployeeIDs that meet the criteria of the main form input.
The query is as follows:
SELECT TblTimeDetail.EmployeeID, Sum([TimeFee]-[InvoicedTime]) AS TimeLeft FROM TblTimeDetail INNER JOIN TblEmployees ON TblTimeDetail.EmployeeID=TblEmployees.EmployeeID GROUP BY TblTimeDetail.EmployeeID, TblTimeDetail.ClientID HAVING (((Sum([TimeFee]-[InvoicedTime]))<>0) And ((TblTimeDetail.ClientID)=forms!frmInvoice.[ClientID]));
TblTimeDetail are the time cards.
Can anyone suggest a solution or a better way of doing this.
Thanks
Lawrence
What I currently have is a combo box on the subform which lists the employees that meet the main form's criteria. However, the user has to select each name from the combo box individually which then populates the other control boxes on the subform. What I would like is the subform to automatically list out all those that meet the criteria.
The main form has for record source "tblInvoice", while the subform has "tblTimeInvoiced". On the other hand, the combo box on the subform uses a query to filter the EmployeeIDs that meet the criteria of the main form input.
The query is as follows:
SELECT TblTimeDetail.EmployeeID, Sum([TimeFee]-[InvoicedTime]) AS TimeLeft FROM TblTimeDetail INNER JOIN TblEmployees ON TblTimeDetail.EmployeeID=TblEmployees.EmployeeID GROUP BY TblTimeDetail.EmployeeID, TblTimeDetail.ClientID HAVING (((Sum([TimeFee]-[InvoicedTime]))<>0) And ((TblTimeDetail.ClientID)=forms!frmInvoice.[ClientID]));
TblTimeDetail are the time cards.
Can anyone suggest a solution or a better way of doing this.
Thanks
Lawrence