T
tminihan
Hi everyone!
I have an summary query to get the gross pay for staring and ending
date. I copied the sql select statement from the query. I'm trying to
use it in vba code so I can get the values and put them into my form.
Problem:
I'm getting the error "Expected line number or label or statement or
end of statement."
Here's the code
"SELECT Sum(tPayrollData_Detail.GrossPay) AS SumOfGrossPay, " & _
"Sum(tPayrollData_Detail.EE401k)AS SumOfEE401k, " & _
"Sum(tPayrollData_Detail.EE401kCatchUp) AS
SumOfEE401kCatchUp, " & _
"Sum(tPayrollData_Detail.Roth401k) AS SumOfRoth401k, " & _
"Sum(tPayrollData_Detail.Roth401kCatchup) AS
SumOfRoth401kCatchup " & _
"FROM tPayrollData_Detail " & _
"WHERE tPayrollData_Detail.EmployeeID = " &
[Forms]![fDataEntry]![txtEmpID] & _
"AND tPayrollData_Detail.CheckDate Between #" &
nz([Forms]![fDataEntry]! [txtFYBegDate]) & _
"# And #" & nz(([Forms]![fDataEntry]![cmbCheckDate]-1) &
"#):"
Would someone please help?
Thanks in advance![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I have an summary query to get the gross pay for staring and ending
date. I copied the sql select statement from the query. I'm trying to
use it in vba code so I can get the values and put them into my form.
Problem:
I'm getting the error "Expected line number or label or statement or
end of statement."
Here's the code
"SELECT Sum(tPayrollData_Detail.GrossPay) AS SumOfGrossPay, " & _
"Sum(tPayrollData_Detail.EE401k)AS SumOfEE401k, " & _
"Sum(tPayrollData_Detail.EE401kCatchUp) AS
SumOfEE401kCatchUp, " & _
"Sum(tPayrollData_Detail.Roth401k) AS SumOfRoth401k, " & _
"Sum(tPayrollData_Detail.Roth401kCatchup) AS
SumOfRoth401kCatchup " & _
"FROM tPayrollData_Detail " & _
"WHERE tPayrollData_Detail.EmployeeID = " &
[Forms]![fDataEntry]![txtEmpID] & _
"AND tPayrollData_Detail.CheckDate Between #" &
nz([Forms]![fDataEntry]! [txtFYBegDate]) & _
"# And #" & nz(([Forms]![fDataEntry]![cmbCheckDate]-1) &
"#):"
Would someone please help?
Thanks in advance