I have tried two different ways to create a query to run to load an Excel spreadsheet. One gives the Run time error 3061 or asks for a list separator. This is the code:
where Text0 is the start date for the payroll week. I have a button that runs a module that uses the Text0 start date, 10/14/2010, for validation then runs a sub routine where the query is located.
The other method I tried was:
where scrit = [SDATE] BETWEEN #10/14/2010# AND #10/20/2010# AND [EDATE] BETWEEN #10/14/2010# AND #10/20/2010#
I received the same error with the second method. Any ideas on fixing this?
Code:
Set RS = DB.OpenRecordset("SELECT * from qryRTRACK_EMP Where" _
& "([SDate] Between #" & Forms![frmReports]![Text0] & "# And # " _
& DateAdd("d", 6, Forms![frmReports]![Text0]) & "#)" _
& " And ([EDate] Between #" & Forms![frmReports]![Text0] & "# And #" _
& DateAdd("d", 6, Forms![frmReports]![Text0]) & "#) ")
where Text0 is the start date for the payroll week. I have a button that runs a module that uses the Text0 start date, 10/14/2010, for validation then runs a sub routine where the query is located.
The other method I tried was:
Code:
Set RS = DB.OpenRecordset("SELECT * from qryRTRACK_EMP Where " & Scrit & "ORDER BY LREF, EMPNAME", dbOpenDynaset, dbReadOnly)
where scrit = [SDATE] BETWEEN #10/14/2010# AND #10/20/2010# AND [EDATE] BETWEEN #10/14/2010# AND #10/20/2010#
I received the same error with the second method. Any ideas on fixing this?