Archiving records from one table to another

chubbychap

New Member
Joined
Jun 3, 2003
Messages
18
Hello All

I should know this one, but I've given up on trying to figure it out!

On pressing a button, is there a way to move records from one table to another, providing certain criteria have been met?

E.g. A date is entered into a "Close Case" field. Every so often the user can click a button on a form and clear out all "Closed Cases" (records with a date in the said field) from the main table and move them to an Archive table.

If anyone can help with this, or point me in the right direction of where to look, it would be greatly appreciated. :rolleyes:

Many Thanks

Chubbychap :p
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You can create an Append Query.

Just add the criteria you want met to the query, and it will only append those records that meet your criteria.

Parra
(y)
 
Upvote 0
Use an append query based on the first table, you can select which table to append to. Place all the fields that are contained in the destination table and put a criteria like "<>Blank" in the criteria field for date to only append those records.


Then also set up a delete query for the first table to delete the records that meet the same criteria.

Now in a Macro tied to a button select the actions to run query and put 1st the append query and then the delete query. This way the data will append to the table and get deleted from the first.


Ziggy
 
Upvote 0
Thanks Ziggy

Thanks Para

I'm now back in Business!!! The most obvious things are always just under your nose.

Chubbychap :p
 
Upvote 0

Forum statistics

Threads
1,221,531
Messages
6,160,357
Members
451,642
Latest member
mirofa

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