Solved

run time error 3061 vba - msaccess

Posted on 2014-02-06
4
789 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

816 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

9 Experts available now in Live!

Get 1:1 Help Now