R
RCGUA
I have two tables, one with Workers Names and the other table has the
Workers Payments
I have a form with a combo box listing the Workers Names. I would
like to selection a workers name from the combo box and then fill a
text box with the sum of all the payments the worker has made.
In the AfterUpdate event for the combo box I have: =========
Private Sub cboWorkerName_AfterUpdate()
DoCmd.OpenQuery "qryTotalPaymentsByWorker3", acReadOnly
End Sub
After updating the combo box, it runs a query to sum they
PaymentAmounts -however- the query pops up a box asking for the
workers name. I want the query to get the WorkersName from the combo
box.
====SQL View of the query=========
SELECT DISTINCTROW tblPayments.WorkerName, Sum
(tblPayments.PaymentAmount) AS [Sum Of PaymentAmount]
FROM tblPayments
WHERE (((tblPayments.WorkerName)=[frmCASA-4payments]![cboWorkerName]))
GROUP BY tblPayments.WorkerName;
Workers Payments
I have a form with a combo box listing the Workers Names. I would
like to selection a workers name from the combo box and then fill a
text box with the sum of all the payments the worker has made.
In the AfterUpdate event for the combo box I have: =========
Private Sub cboWorkerName_AfterUpdate()
DoCmd.OpenQuery "qryTotalPaymentsByWorker3", acReadOnly
End Sub
After updating the combo box, it runs a query to sum they
PaymentAmounts -however- the query pops up a box asking for the
workers name. I want the query to get the WorkersName from the combo
box.
====SQL View of the query=========
SELECT DISTINCTROW tblPayments.WorkerName, Sum
(tblPayments.PaymentAmount) AS [Sum Of PaymentAmount]
FROM tblPayments
WHERE (((tblPayments.WorkerName)=[frmCASA-4payments]![cboWorkerName]))
GROUP BY tblPayments.WorkerName;