Results 1 to 2 of 2
Thread: CurrentDB.Execute problems
09-06-08, 11:03 #1Registered User
- Join Date
- Mar 2008
Unanswered: CurrentDB.Execute: Too few parameters
I'm using Access 2002, and I'm running into an issue with using CurrentDB.Execute to run an 'append' query. My code is simply this:
strQueryName = "qry_20_AvgInboundPieces_Monthly_3Count" CurrentDb.Execute strQueryName, dbFailOnError
Run-time error '3061':
Too few parameters. Expected 2.
I've verified that the query works by running it other ways. I can double-click on it and it fires off just fine, and it plays nice with DoCmd.OpenQuery. I'm trying to get away from DoCmd.OpenQuery because of having to use SetWarnings False/True to make it not ask me if I'm sure I want to update the table when the query runs. I have read several suggestions other places saying to use CurrentDb.Execute instead, but I cannot get it to work. I've tried it without the dbFailOnError, and I've tried these, both with and without dbFailOnError:
strQueryName = "qry_20_AvgInboundPieces_Monthly_3Count" CurrentDb.QueryDefs(strQueryName).Execute dbFailOnError CurrentDb.QueryDefs("qry_20_AvgInboundPieces_Monthly_3Count").Execute dbFailOnError
"PARAMETERS [Forms]![frmMain]![txtMonthBegin] DateTime, [Forms]![frmMain]![txtMonthEnd] DateTime;"
Last edited by thinker5555; 09-06-08 at 11:46.
09-06-08, 13:41 #2King of Understatement
Originally Posted by thinker5555
- Join Date
- Feb 2004
- One Flump in One Place
I haven't done it for years so can't be much more specific but the above should give you enough to google around - come back if you don't crack it.Testimonial:
ur codings are working excelent.