Senin, 24 Februari 2014

[MS_AccessPros] RE: Create Delete button that archives the record you have open in the form

 

Dale

Why not just add a bit (Yes/No) field named Archived to your original table and have the user just check the record as "archived". Then you just change your form's recordsource so it shows only rows where Archived is No/False/0. That way there is no need to move the record. And that will also not cause bloat that is caused by constant inserting and deleting records.

I use that technique, but I call the field "Active" with a default of -1 (yes/true) in most of my tables. Users tend to want to take items out of lists, records out of tables and then change their minds. This way, all you do is change the value in that field.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
http://mvp.microsoft.com/en-us/mvp/Bill%20Mosca-35852
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com



---In MS_Access_Professionals@yahoogroups.com, <tenn_tazz26@yahoo.com> wrote:

I am using MS Access 2007 and I am trying to figure out how to make a delete button in a form that when a user clicks on it, it will confirm if they wish to delete the record and in the prompt it will show the records FirstName and LastName field, and when they click to confirm the deletion that behind the scenes it will copy that record to an archive table before deleting it from the main table. The form name I am using is called MainForm and the table that is storing the data is called Main. The archive table I created is a copy of the Main table structure and I called it DeleteMainArchive. I thought of using a Macro in combination with an append query but never could figure out how to make the query capture the current record rather then all records.


Thanks,

Dale

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
.

__,_._,___

Tidak ada komentar:

Posting Komentar