Run time error 3061- Too few parameters, expected 1- VBA ACCESS

Dear Experts,

Can you please help me to solve this issue.
Getting Run time error 3061- Too few parameters, expected 1- VBA ACCESS in the following query,


CurrentDb.Execute "insert into REVIEW_MAIN (Profile_ID,Reviewer_Id,Review_Number,Review_Date,Additional_Review,Final_Review,APPI_Review,FPPI_Review,Punctual_Submission,Presentation,Presentation_Comments) values (ProfileIDR,'" & Me.Combo_Reviewer_RInsert.Value & "','" & Me.Combo_RT_RInsert.Value & "','" & Me.Combo_ReviewInsert.Value & "','" & Me.Check_AR_RInsert.Value & "','" & Me.Check_FR_RInsert.Value & "','" & Me.Check_APPI_RInsert.Value & "','" & Me.Check_FPPI_RInsert.Value & "','" & Me.Check_PS_RInsert.Value & "','" & Me.Combo_Present_RInsert.Value & "','" & Me.Text_PC_RInsert.Value & "')"

Note: Profile_ID,Reviewer_Id,Review_Number- all these field's data type is number
          ProfileIDR is a variable which stores an ID, i used cint(ProfileIDR ) but no changes.

Thanks,
George
gtmathewDallasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
George,

  When your doing SQL on the fly like this, do it this way:

Dim strSQL as string

strSQL = "insert into REVIEW_MAIN (Profile_ID,Reviewer_Id,Review_Number,Review_Date,Additional_Review,Final_Review,APPI_Review,FPPI_Review,Punctual_Submission,Presentation,Presentation_Comments) values (ProfileIDR,'" & Me.Combo_Reviewer_RInsert.Value & "','" & Me.Combo_RT_RInsert.Value & "','" & Me.Combo_ReviewInsert.Value & "','" & Me.Check_AR_RInsert.Value & "','" & Me.Check_FR_RInsert.Value & "','" & Me.Check_APPI_RInsert.Value & "','" & Me.Check_FPPI_RInsert.Value & "','" & Me.Check_PS_RInsert.Value & "','" & Me.Combo_Present_RInsert.Value & "','" & Me.Text_PC_RInsert.Value & "')"

CurrentDB.Execute strSQL, dbFailOnError

Why?  Because you can put a breakpoint or stop before the execute and examine the finial SQL statement (hover over it or use the debug window) before you try to execute it.  Makes it real easy to spot errors such as this.

BTW, you statement looks correct, so I'm guessing you have a mis-spelling somewhere.  Should be very easy to spot when you view the statement.

Jim.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gtmathewDallasAuthor Commented:
Hi Jim
Thanks you so much for your reply,
the problem is related to the values of check box fields
(Me.Check_AR_RInsert.Value & "','" & Me.Check_FR_RInsert.Value & "','" & Me.Check_APPI_RInsert.Value & "','" & Me.Check_FPPI_RInsert.Value & "','" & Me.Check_PS_RInsert.Value & "')
I can insert the values to the table without above fields, so can you please help me to include those check box vales n the query (its yes/no in the table field)
Thanks
George
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<I can insert the values to the table without above fields, so can you please help me to include those check box vales n the query (its yes/no in the table field)>>

 True/False are numeric values so no quotes.

Jim.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

gtmathewDallasAuthor Commented:
Jim,

Following is the printed SQL,

insert into REVIEW_MAIN (Profile_ID,Reviewer_Id,Review_Number,Review_Date,Additional_Review,Final_Review,APPI_Review,FPPI_Review,Punctual_Submission,Presentation,Presentation_Comments) values ('12','62','7','3/26/2012','-1','-1','-1','','','Accurate','dfcfgsadfa')

If all the check boxes are checked - query will work, but its not- if any unchecked, see the '','', values in query.
Please help me

Thanks,
George
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
George,

 Did you get it working?

 Sorry I missed your last comment (sometimes I go a little too fast in deleting my e-mails).

Jim.
0
gtmathewDallasAuthor Commented:
Yes Jim, Its working now (with unchecked check box), but i didnt change any coding :)
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<Yes Jim, Its working now (with unchecked check box), but i didnt change any coding :)>>

 Make sure the TripleState property on the check boxes are set to "no"

Triple State allows True (-1), False (0), and NULL

 You don't want null's in there.

Jim.
0
gtmathewDallasAuthor Commented:
Yes Jim It is set to 'No'

Thanks,
George
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.