Solved

run time error 3061 vba - msaccess

Posted on 2014-02-06
4
784 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
4 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
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 34

Expert Comment

by:Dan Craciun
Comment Utility
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 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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
Comment Utility
Thank you so much Rey.. It works.. Thank you Dan and Joe for your valuable time..
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now