[font=Courier New][size=2][color=red][color=red]audReason = InputBox("Give a reason for changes")[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]'Remove any cancelled update still in the tmp table.[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]Set db = DBEngine(0)(0)[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]sSQL = "DELETE FROM " & sAudTmpTable & ";"[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]db.Execute sSQL[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black] [/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]' If this was not a new record, save the old values.[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]If Not bWasNewRecord Then[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]sSQL = "INSERT INTO " & sAudTmpTable & " ( audType, audDate, audUser, audReason ) " & _[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]"SELECT 'EditFrom' AS Expr1, Now() AS Expr2, NetworkUserName() AS Expr3, [/color][/color][/size][/font][color=red][color=red]audReason AS Expr4[/color][/color][color=black][color=black], " & sTable & ".* " & _[/color][/color][font=Courier New][size=2][color=black][color=black]"FROM " & sTable & " WHERE (" & sTable & "." & sKeyField & " = " & lngKeyValue & ");"[/color][/color][/size][/font][font=Courier New][size=2][color=red][color=red]db.Execute sSQL, dbFailOnError '(code gives here error 3061; to few paramters, expected 1)[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]End If[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]AuditEditBegin = True[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black] [/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]Exit_AuditEditBegin:[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]Set db = Nothing[/color][/color][/size][/font][font=Courier New][size=2][color=black][color=black]Exit Function[/color][/color][/size][/font]