moving a record from one table to another

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
I am working with two tables with a one to many relationship.

I have used the 2 tables to create a form with a subform.

When a user marks a record for deletion useing a check boxe I want to copy the record includeing the data on the subform to 2 separate tables, that are exact copies of the original 2 tables the only difference is that these two table would only have deleted records. Then of course I would delete the records from the original two tables.

I am tring to keep the records marked for deletion in separate table idential to the original two and maintain the one to many relationship. Is this possible or do I have to create a query using the 2 original table and make one large table with the fields from both original tables to hold the deleted records?


Thanks
Liz
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Why delete the records? You could add a Yes/No field that indicates that the records are no longer needed.

This could then be used in queries/forms etc to only view current records.
 
Upvote 0
Following on from Norie, I agree that it would be better / easier to retain the records in the original table and to flag them for exclusion. However, rather than create a Yes / No field, you could use the check box you already have in place and use this field to determine which records you no longer want to show on the forms and reports. This makes it far easier to undelete records later on.

However, if you really must transfer the records to 2 new tables then yes it can be done, and I would do it using 4 queries - one to append the main data across, another to append the subform data, and 2 queries to delete the old records from both tables. You can then wrap all of these queries up in a single macro and attach it to a button on one of your forms.

HTH, Andrew. :)
 
Upvote 0
Thanks
Norie and Andrew

I agree, I will take your advice and leave them in the 2 original tables.

Thanks again
Liz
 
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top