Hello,

my problem is the following one :

this is a simplification of my problem:
i have a table with no record at the beginning but this must be. This table have four fields : "line", "stopi", "stopn"and "tfact". A form help me to complete "line", "stopi", "stopn" with three textbox. A button normally save the record in the table and complete the record with a value of "tfact" given by me in vba code. I can't do this update !! Why ? And How to do this ?

this is my code for the moment :
Option Compare Database
Private Tw As ADODB.Recordset
Private Sub form_Open(cancel As Integer)
Set Tw = New ADODB.Recordset
Tw.CursorType = adOpenKeyset
Tw.LockType = adLockOptimistic
Tw.Open "tbwork", CurrentProject.Connection, , , adCmdTable
End Sub
Private Sub enr_work_Click()
On Error GoTo Err_enr_work_Click
DoCmd.RunCommand (acCmdSaveRecord)
DoCmd.GoToRecord , , acNext

'Tw.Move(0) 'in current record put 12 in the field "tfact"
'Tw.Fields("tfact").Value = 12
'Tw.Update
'Tw.Close


Exit_enr_work_Click:
Exit Sub

Err_enr_work_Click:
MsgBox Err.Description
Resume Exit_enr_work_Click

End Sub

Thanks a lot !!!