C
CarolChi
Why does this code for updating a single existing record in a linked table
not work please?
I see the updates in the recordset, but they don't get written back to the
table.
The recordcount is just to make sure I have a single record.
strSQL = "SELECT * FROM tblUnconfirmed WHERE lngInterco = " & lngInterco
Set rst1 = New ADODB.Recordset
With rst1
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open Source:=strSQL
.MoveFirst
.MoveLast
i = .RecordCount
.Edit
.Fields("dtmRefused").Value = Null
.Fields("dtmAccepted").Value = dtmAccepted
.Fields("txtContactB").Value = strContactB
.Fields("txtReason").Value = ""
.Fields("dtmBookMonth").Value = dtmBookMonth
.Update
End With
not work please?
I see the updates in the recordset, but they don't get written back to the
table.
The recordcount is just to make sure I have a single record.
strSQL = "SELECT * FROM tblUnconfirmed WHERE lngInterco = " & lngInterco
Set rst1 = New ADODB.Recordset
With rst1
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open Source:=strSQL
.MoveFirst
.MoveLast
i = .RecordCount
.Edit
.Fields("dtmRefused").Value = Null
.Fields("dtmAccepted").Value = dtmAccepted
.Fields("txtContactB").Value = strContactB
.Fields("txtReason").Value = ""
.Fields("dtmBookMonth").Value = dtmBookMonth
.Update
End With