Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

run time error 3061 vba - msaccess

Posted on 2014-02-06
4
Medium Priority
?
801 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

609 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