Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 3061 - Too few parameters. Expected 1. 1

Status
Not open for further replies.

AlexMidd

Programmer
May 14, 2001
655
NL
Ha sanyone come across this error when programming in VBA before? The specific situation is where I am opening a recordset, e.g.

dbs = currentdb()
set rst = dbs.openrecordset(<table/query name>, dbOpendynaset)

This produces:
&quot;Error 3061 - Too few parameters. Expected 1&quot;.

I cannot understand it as there is one paramater. This statement works some times and not others and I cannot see the reason for it. It happens whether the <table/query name> is an SQL statement, literal table/query name or whatever. Any clues?

Cheers,
Alex Middleton
 
Hi Alex,

I had this same error message and what I discovered was an invalid field name in my SELECT statement (it was off by one letter, ilngRecID, vs. lngRecID) that created the source records for a DLOOKUP function. Drove me nuts until I sat down and went over my code with &quot;a fine tooth comb&quot; as the saying goes.

Hope this helps.
Who takes 7 seconds to develop,
7 mins to document,
7 hours to test,
7 months to fix will always blame the clock. s-)
 
Yes, I thought of that but it wasn't that. There seems to be no rhyme or reason for it. In one module it will work, in another the exact same one refuses to work, even though it is accessing the same/valid table/query etc.

Thanks

Alex Alex Middleton
 
I just had the same issue with my database and that was EXACTLY what was wrong (I was using CompanyType_ID when it should have been ContactType_ID). Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top