Solved

run time error 3061 vba - msaccess

Posted on 2014-02-06
4
787 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
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 34

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 119

Accepted Solution

by:
Rey Obrero earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

863 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

26 Experts available now in Live!

Get 1:1 Help Now