Urgent Help with Error "Too Few Parameters, expected 2"

parth00

Registered User.
Local time
Today, 03:57
Joined
Sep 23, 2005
Messages
25
Hi All,
I can't get this simple query wroking in my Code....I am getting following error while running it
"Run-time error 3061" Too Few Parameters, expected 2"

Here is my Code:

Dim Fname As String
Dim ID As Integer
Dim SSQL As String
Dim SSQL1 As String

Fname = Trim(List_Resource_Combo)
ID = Forms!Add_Project_Details!Oppt_ID

SSQL = "UPDATE Sales_Pipeline_Current SET [Sales_Pipeline_Current].R_List = Fname where [Sales_Pipeline_Current].oppt_Id = ID ;"

Set db = CurrentDb()
db.Execute (SSQL)
db.Close

I made sure Both the variable (Fname and ID) are assigned values. Query runs fine in Access Query Wizard..

Thanks
Parth
 
Last edited:
Hi
Try in SSQL = to the value ID (= 2)
I beleive it needs ' '
 
Something like :

SSQL = "UPDATE Sales_Pipeline_Current SET [Sales_Pipeline_Current].R_List = " & "'" & Fname & "'" & " where [Sales_Pipeline_Current].oppt_Id = " & ID & ";"

assuming Fname is a string and ID a number
 
Richary,
One More Question.....

The query listed below concatenate Fame value to current [Sales_Pipeline_Current].R_List value.

Example : If R_List = “Richard Reed”
And Fname = “Parth, Pathak”

After running query it becomes “Richard,ReedParth,Pathak”

How do I add space between two names (Richard,Reed Parth,Pathak)


SSQL = "UPDATE Sales_Pipeline_Current SET [Sales_Pipeline_Current].R_List ="
SSQL = SSQL & "[Sales_Pipeline_Current].R_List " & "&" & " " & " " & " '" & Fname & "'"
SSQL = SSQL & " where [Sales_Pipeline_Current].oppt_Id = " & ID & ";"
 
try

ssql = ssql & "[Sales_Pipeline_Current].R_List & ' ' " & "& '" & fname & "'"

for the second line of code
 

Users who are viewing this thread

Back
Top Bottom