I have a query for a form that works fine 'qryUTable'
The parameter is:
uTABLE.WEdate)=[forms]![frmDemo]![tWEdt]
Where [tWEdt] is a unbound control for entering a date.
The query works fine and returns the correct records. When I call this query in code:
I get the error 3061 "To few Parameters. Expected 1."
If I take the criteria out of the query
" uTABLE.WEdate)=[forms]![frmDemo]![tWEdt]"
The code runs fine.
Any help would be appreciated.
Code:
SELECT uTABLE.EmpRegNo, uTABLE.EmpJobTransID, [EmpForename] & " " & [EmpSurname] AS Name, uTABLE.JobsID, TESTjobs.JobName, uTABLE.WEdate, uTABLE.strFormInfo
FROM (uTABLE INNER JOIN tblEmployee ON uTABLE.EmpRegNo = tblEmployee.EmpRegNo) INNER JOIN TESTjobs ON uTABLE.JobsID = TESTjobs.JobsID
WHERE (uTABLE.WEdate)=[forms]![frmDemo]![tWEdt])
ORDER BY uTABLE.EmpRegNo, [EmpForename] & " " & [EmpSurname], TESTjobs.JobName, uTABLE.WEdate;
The parameter is:
uTABLE.WEdate)=[forms]![frmDemo]![tWEdt]
Where [tWEdt] is a unbound control for entering a date.
The query works fine and returns the correct records. When I call this query in code:
Code:
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("qryUTable", dbOpenDynaset)
I get the error 3061 "To few Parameters. Expected 1."
If I take the criteria out of the query
" uTABLE.WEdate)=[forms]![frmDemo]![tWEdt]"
The code runs fine.
Any help would be appreciated.