Delete Record in table with code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The .MoveNext takes me to the deleted record. How do I get rid of this
record? I thought the .delete also removed it from the table, but it doesn't
until I close the table.

Here is my code....

With Mytable
do while not .eof
.Delete
.MovePrevious
.Edit
!EndTime = txtEndTime
!FuncSeq1 = !FuncSeq1 & TempFuncText2
!TheDevice = RobotName
.Update
.MoveNext
loop
end With

Thanks,

Sarah
 
Hi,
well, you can either reopen recordset, or requery it. What you can do - is
to save primary key of last edited record (after .Update), then requery (or
close and then open recordset), then go back to this record using findfirst,
and then MoveNext

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 
Back
Top