I have a summary query in Access97. I look for staring and ending date
and sum the grosspay. I took the sql from the query and I'm trying to
convert it in VBA withing Access. I keep getting Error: Expected line
number or label or statement or end of statement. I know I'm missing
something, but I can't figure it out. Help?
"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) &
"#):"
Thanks in advance! :)