Update Table

Bigpapou
05-23-2001, 01:02 PM
I'm trying to Update a table (TblRapport) and I have a probleme With the folowing code:
**************************************
Dim In As String, Msg As String, SQL As String

Msg = "What's the final number?"
In = InputBox(Msg, "Final number", 2000, 2000)
SQL = "UPDATE TblRapport SET OdometreFin = in WHERE (Inspecteur = """ & TxtInspecteur & """);"

CurrentDb.Execute (SQL) <= ERROR OCCURS HERE
*****************************************
Access is always giving me the error 3061 ...
in french it's (Trop peu de paramètres. 1 attendu.)

Does anyone knows what's the pro.
Thank to all how tried.

kingesk
05-23-2001, 03:05 PM
Since "IN" is a variable it needs to be seperated by an "&". If it is defined as a text in your table it will need to sorrunded by single quotes. If it is defined as a number take out the single quotes. Hope this works for you,

Eric

Dim In As String, Msg As String, SQL As String

Msg = "What's the final number?"
In = InputBox(Msg, "Final number", 2000, 2000)
SQL = "UPDATE TblRapport SET OdometreFin = '" & In & "' WHERE Inspecteur = '" & TxtInspecteur & "';"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum