Error 3061

A

Alain

Hi to all,

I am getting the error 3061 Too few parameters atthe update statement and I
would like to know what can cause this
the code I use is this:

Dim temp As Integer, ntemp As String
Dim str As String

temp = Nz(Rst.Fields(0).Value, 0)
ntemp = Format(temp + 1, "000")
Debug.Print ntemp
'concaténation de variables pour création du ReferenceNo
str = "L"
ntemp = str & ref & ntemp
Debug.Print ntemp
'mise à jour de la table avec le nouveau ReferenceNo
CurrentDb.Execute _
"UPDATE tblLease SET LeaseRefNo = " & ntemp & " WHERE [IdLease] =" & num &
""

I have tried different combination of quote for the ntemp since it is a
string, I do not get an error but no value is being saved in my table
Need help for understanding
Thanks

Alain
 
D

Dan Artuso

Hi,
Strings: delmit with quotes
Numbers: no delimiters
Dates: delimit with #

So if it's a string:
" WHERE [IdLease] ='" & num & "'"
 
A

Alain

Thanks Dan,


Dan Artuso said:
Hi,
Strings: delmit with quotes
Numbers: no delimiters
Dates: delimit with #

So if it's a string:
" WHERE [IdLease] ='" & num & "'"

--
HTH
-------
Dan Artuso, MVP


Alain said:
Hi to all,

I am getting the error 3061 Too few parameters atthe update statement
and I
would like to know what can cause this
the code I use is this:

Dim temp As Integer, ntemp As String
Dim str As String

temp = Nz(Rst.Fields(0).Value, 0)
ntemp = Format(temp + 1, "000")
Debug.Print ntemp
'concaténation de variables pour création du ReferenceNo
str = "L"
ntemp = str & ref & ntemp
Debug.Print ntemp
'mise à jour de la table avec le nouveau ReferenceNo
CurrentDb.Execute _
"UPDATE tblLease SET LeaseRefNo = " & ntemp & " WHERE [IdLease] =" &
num &
""

I have tried different combination of quote for the ntemp since it is a
string, I do not get an error but no value is being saved in my table
Need help for understanding
Thanks

Alain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top