Share via

Remove #Deleted# record

Anonymous
2016-02-11T23:47:32+00:00

I have a split form named "ScheduleForm" based on a table named "Schedule". When I mark the Cancelled field True (it is a True/False field) I want to delete the record from the table Schedule and add it to the table ScheduleArchive.

The following runs:

Private Sub Cancelled_AfterUpdate()

If Me!Cancelled = True Then

    Me![ShipCancDate] = Date

    DoCmd.Save

    DoCmd.SetWarnings False

    DoCmd.OpenQuery "AddToScheduleArchive"

    DoCmd.Save

    DoCmd.OpenQuery "DeleteFromSchedule"

    DoCmd.SetWarnings True

    Form.Requery

End If

End Sub

However, the form still shows the deleted record as #Deleted# in all fields and the line Form.Requery gives an error 3167 "The record is deleted".

How can I make the deleted record "Disappear" ?

The query "AddToScheduleArchive" is: INSERT INTO ScheduleArchive SELECT Schedule.* FROM Schedule WHERE (((Schedule.SONo)=[Forms]![ScheduleForm]![SONo]));

The query "DeleteFromSchedule" is: DELETE Schedule.*, Schedule.SONo FROM Schedule WHERE (((Schedule.SONo)=[Forms]![ScheduleForm]![SONo]));

Thanks in advance....

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments