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 strongm 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 3601 -- Too Many Parameters

Status
Not open for further replies.

bostonfrog

Programmer
Jul 14, 2003
79
MX
Before submitting this, I did read other posts regarding this run-time error but didn't find the answer.
It's a simple DAO Recordset (Dim Rs as DAO.Recordset), and I get this error, saying there TOO MANY PARAMETERS, Expected 1 -- and no help available on the subject.

Code:
strSQL = "SELECT PATIENT.ID FROM tblPATIENTS "
strSQL = strSQL & "WHERE PATIENT.ID = Forms!MyForm!txtID;"
Set rs = Currentdb.OpenRecordset(strSQL)

On this error, the Set rs = line of code is highlighted in yellow and rs = nothing is the tip when I click on the error. Any advice, DAO experts?
 
at a quick glance you need to adjust your query string and quote marks.

strSQL = "SELECT PATIENT.ID FROM tblPATIENTS "
strSQL = strSQL & "WHERE PATIENT.ID = " & Forms!MyForm!txtID & ";"
Set rs = Currentdb.OpenRecordset(strSQL)
 
Hi bostonfrog,

I suspect it's because you are trying to find PATIENT.ID in Table tblPATIENTs.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top