I've created a combo box which displays all the possible Dates to choose from. I'd like to make a recordset based on the Date chosen in the combo box. I've pasted the code below, which formats the combo box date and sets the expression I built in the recordset equal to the specific date as criteria. I want to build a recordset that only contains data from the Date selected in the combo box.
When I run the code I get run-time error 3061, too few arguments, expected 1.
Any suggestions would be greatly appreciated.
When I run the code I get run-time error 3061, too few arguments, expected 1.
Any suggestions would be greatly appreciated.
Code:
Dim SimpleDate
SimpleDate = Format(Me.Date, "mmm dd yyyy")
Dim rs As Recordset, db As Database
Set db = CurrentDb()
Set rs = db.OpenRecordset("select [Ni-Au-Date/Time],[Ni-Au-Shift],[Ni-Au-RunHoursExpected]," _
& "Format([Ni-Au-Date/Time],'mmm dd yyyy') as FormatDate" _
& " from [Ni-Au-Production Log]" _
& " where [Ni-Au-Shift]=1 and FormatDate='" & SimpleDate & "'" _
& " order by [Ni-Au-Date/Time]")