S
Synergy Tooling Systems
I'm stumped. This following method is giving me an error:
Run time error '3061'
Too few parameters. Expected 1.
CurrentDb.Execute "INSERT INTO FindOrderRowSourceTemp ( ordID, ordJob, ordCustName, ordProdLocation, Days ) " & _
"SELECT [Order Entry Header].ordID, [Order Entry Header].ordJob, [Order Entry Header].ordCustName, [Order Entry Header].ordProdLocation, DateDiff('d',[ordDate],Date()) AS Days " & _
"FROM [Order Entry Header] " & _
"WHERE ((DateDiff('d',[ordDate],Date())<=" & i & ") AND [Order Entry Header].ordProdLocation = [Location Filter]) " & _
"ORDER BY [Order Entry Header].ordJob DESC;"
I put this into the QBE grid make adjustments for the variable i and removing the the quotes and ampersands and it was fine.
I have another similar method in the same procedure, without the "AND [Order Entry Header].ordProdLocation = [Location Filter]) " clause which works fine.
So the Where clause is the problem, but I can't see what it.
Thanks for any help.
Synergy
Run time error '3061'
Too few parameters. Expected 1.
CurrentDb.Execute "INSERT INTO FindOrderRowSourceTemp ( ordID, ordJob, ordCustName, ordProdLocation, Days ) " & _
"SELECT [Order Entry Header].ordID, [Order Entry Header].ordJob, [Order Entry Header].ordCustName, [Order Entry Header].ordProdLocation, DateDiff('d',[ordDate],Date()) AS Days " & _
"FROM [Order Entry Header] " & _
"WHERE ((DateDiff('d',[ordDate],Date())<=" & i & ") AND [Order Entry Header].ordProdLocation = [Location Filter]) " & _
"ORDER BY [Order Entry Header].ordJob DESC;"
I put this into the QBE grid make adjustments for the variable i and removing the the quotes and ampersands and it was fine.
I have another similar method in the same procedure, without the "AND [Order Entry Header].ordProdLocation = [Location Filter]) " clause which works fine.
So the Where clause is the problem, but I can't see what it.
Thanks for any help.
Synergy