Got a strange one here because I have used what i thought was exactly the same syntax in another query string and gotten no problems.
I'm passing the value of a combobox to a string and executing it as a query in vba, but I keep getting asked for a parameter.
I've checked the control name, done debug.print for the value and that is coming out correctly but I keep getting asked for the parameter.
The code is below and I've attached a screenshot of the error message:
Hope someone can point out the idiot mistake
I'm passing the value of a combobox to a string and executing it as a query in vba, but I keep getting asked for a parameter.
I've checked the control name, done debug.print for the value and that is coming out correctly but I keep getting asked for the parameter.
The code is below and I've attached a screenshot of the error message:
Code:
"SELECT Tbl_Costing.EmpName, Sum(Tbl_Costing.HoursWorked) AS SumOfHoursWorked, Tbl_Costing.WeekEnding FROM Tbl_Costing WHERE Tbl_Costing.EmpName= " & Cbo_EmpName.Value & " And Tbl_Costing.WeekEnding Between #" & Format(CDate(Txt_StartDate.Value), "mm/dd/yy") & "# And #" & Format(CDate(Txt_EndDate.Value), "mm/dd/yy") & "# GROUP BY Tbl_Costing.Empname, Tbl_Costing.Weekending;"
Hope someone can point out the idiot mistake