?
Solved

run time error 3061 vba - msaccess

Posted on 2014-02-06
4
Medium Priority
?
799 Views
Last Modified: 2014-02-07
When I am running this query getting error message run time error 3061, too few parameters,

sqlu = "UPDATE Employee_Room_Status Set L_Name = " & Me.List2Edit.Column(0, i) & ", F_Name = " & Me.List2Edit.Column(1, i) & ", M_Name = " & Me.List2Edit.Column(2, i) & "   WHERE Person_Number = " & Me.List2Edit.Column(3, i) & " "

Immediate window  showing:
sqlu = UPDATE Employee_Room_Status Set L_Name = Mathew, F_Name = George, M_Name = T   WHERE Person_Number = 2323

Please help
0
Comment
Question by:gtmathewDallas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 75
ID: 39840630
You cannot refer to the Column Property of a Combo or List box in a query. But, you can put those values in hidden text boxes and refer to them.

mx
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39840632
Try quoting the values:
sqlu = "UPDATE Employee_Room_Status Set L_Name = '" & Me.List2Edit.Column(0, i) & "', F_Name = '" & Me.List2Edit.Column(1, i) & "', M_Name = '" & Me.List2Edit.Column(2, i) & "'   WHERE Person_Number = '" & Me.List2Edit.Column(3, i) & "'"

Open in new window


HTH,
Dan
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39840640
try this


sqlu = "UPDATE Employee_Room_Status Set L_Name = '" & Me.List2Edit.Column(0, i) & "', F_Name = '" & Me.List2Edit.Column(1, i) & "', M_Name = '" & Me.List2Edit.Column(2, i) & "'   WHERE Person_Number = " & Me.List2Edit.Column(3, i)


or


sqlu = "UPDATE Employee_Room_Status Set L_Name = " & Chr(34) & Me.List2Edit.Column(0, i)  & Chr(34) &  ", F_Name = " & Chr(34) &  Me.List2Edit.Column(1, i) & Chr(34) &  ", M_Name = " & Chr(34) &  Me.List2Edit.Column(2, i) & Chr(34) & "   WHERE Person_Number = " & Me.List2Edit.Column(3, i)
0
 

Author Closing Comment

by:gtmathewDallas
ID: 39842343
Thank you so much Rey.. It works.. Thank you Dan and Joe for your valuable time..
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question