View Single Post
  #2  
Old October 16th, 2009, 05:10 PM posted to microsoft.public.access.tablesdbdesign
Piet Linden[_2_]
external usenet poster
 
Posts: 280
Default using a date as archiving trigger

On Oct 16, 10:23*am, Grasavong
wrote:
Hello,
I have a question that I'm not sure if it's possible for Access 2003. I'm
creating a database where we would like to use a project's end-date as the
trigger for archiving the record (row) to an 'archived' or 'completed' table.

For example: Suppose Project #10 was finished on 10/10/09. Once someone
enters that field (which is called 'Completed Date') with a date, the record
is automatically removed from the current table and sent to an 'archived' or
'completed' table.

I was wondering if this is possible instead of having to manually cutting
each row that has a finished project to the completed table.


Unless you have a LOT of data (in excess of 2 million rows or so), you
shouldn't need to do this... If you filter for archived/non-archived
and base queries on that, everything will work fine. Just make sure
you index the 'Completed Date' column.

You could do what you want in the AfterUpdate event of the
CompletedDate control on your form. Something like:
-- NOTE: both queries will have the same filter (e.g. = Me.RecordID)
DBEngine(0)(0).Execute "appendQuery"
DBEngine(0)(0).Execute "deleteQuery"

I would STRONGLY recommend testing this out on a junk table. So if
you make a mistake you don't mess up your real data.