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!

Too few paramaters

Status
Not open for further replies.

starswirl

Technical User
Aug 3, 2003
5
US
I am working on a code for an appointment book using access 2000 and VB6. I was using this statement to call the information from my database to the interface

Data3.RecordSource = "Select LastName1, FirstName1, PhoneNumber1, AlternatePhoneNumber1, Relationship1, LastName2, FistName2, PhoneNumber2, AlternatePhone2, Relationship2 from [contact information] where [social security] = '" + txtSSNumber.Text + "'"
Data3.Refresh

and it is giving me the run time error 3061 Too few parameters. Expected 2.

Does anyone know what I am doing incorrectly?
 


Check the spelling of your column names in the SELECT statement. Normally this error pops up when a non-existant column is specified...


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
In my experience, that message is almost always translated as "you got a field name wrong" (or two of them in your case.) At a quick glance I suspect that "FistName2" should be "FirstName2". Check the field names in your table against those in your Select list.
 
I went ahead and checked my spelling I did have one spelling error.

But when I re-ran it, it gives me the error still except this time it says Expected 1.

Could it be something else?
 
Can't be sure without seeing your table but I notice that you have "AlternatePhoneNumber1" and "AlternatePhone2". Should "Number" be added to one of them or removed from the other?
 
I got it the mistake was that instead of data3.refresh, i needed to use data3.updaterecord.

Thank You!!
 
Odd ...

"Refresh" pulls data from the database and "UpdateRecord" saves it. But, if you say it's working ...
 
see thread705-521771 for a discussion of this problem

gusset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top