Create a Table for deleted records, and recover this records again (1 Viewer)

Hamatto

New member
Local time
Today, 06:38
Joined
Jun 17, 2024
Messages
8
Hello friends,
please, I want your help in attachement file about VBA code for Creating a Table2 for deleted records of Table1 And then I can recover any record(I found that I need it) again from Table2 to table1
Any help will be appreciated
Thanks a lot for your Help.
 

Attachments

  • New Microsoft Access Database.accdb
    556 KB · Views: 6

plog

Banishment Pending
Local time
Yesterday, 22:38
Joined
May 11, 2011
Messages
11,730
You don't move records around in a database. Instead, you use data to set it to a status.

In this case you should add a field to your table. Call it 'Deleted' and make it a Yes/No field and default it to No. When you want to 'delete' a record you just set that field to Yes. If you ever need to recover it, you change the field back to No.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:38
Joined
Oct 29, 2018
Messages
21,709
I agree about simply flagging the data as deleted rather than actually erasing them from the table, especially if you foresee that you may need to restore them in the future. Consider using a date/time field as a flag, so you can better control the restoration process. Just a thought...
 

Hamatto

New member
Local time
Today, 06:38
Joined
Jun 17, 2024
Messages
8
Sorry, I didn't Understand.
May Please help me by example on the attachement file?
 

Users who are viewing this thread

Top Bottom