Discussion Locked

MS Access Table - differences over time

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an Access table with 4500 records and more than 10 fields. (It's a table that's automatically generated whenever someone chooses to import it from the unigates.) Every 3 months, I print a hardcopy of 4 fields of this table and compare it to the last copy to find adds, deletes and changes to the records. It takes a VERY LONG TIME. Isn't there a way I can save a copy of this table into a new table and compare 2 of them programmatically to tell me what's changed? Maybe even using VB to look at each 1st field to find a matching record in the other table, and comparing the other 4 fields and only reporting records that have changed? I know some VB, but not how to use it with Access, so specific examples would be appreciated as to how Ican accomplish this task accurately without having to do it manually.

5 replies

by lo

Hi - if you have/controll (or have access to) the code that is doing the update, modify it and the table for a 'changed' field. You can just put a code (A=Added, C=Changed, D=Deleted, etc.) or a date/time of last change (Add & Delete are 'changes'). Given you have that you can search the table for the code or for records that have a date/time since the last time you ran the maintenance.

To get what changed there are many ways. One would be to keep a second table (or database) (same fieldsmaster). Before you update the master, copy the current record to the change table. For records that changed in the master, do a field/field compare and print a report of the differences (or just print all fields for each table, one over the other). Not specific example but ... lo

by donq

If your download ALWAYS has the same name and structure I suggest you take the last download available and do a "Make Table" query naming it "whatever". Then add a new field "LUD" (for last update) and assign it Date/Time with the default set to Now() and formatted "General Date". This will automatically create a new timestamp every four months if you do an "Append" query to add records, "Update" query to revise records, and compare to list deletions followed by a "Delete" query to update "whatyever". Then just throw the new import away and base your report on LUD values greater than Now() + your delete listings. Hope this helps and you only need to update the 4 fields I guess? It should make "whatever" a little smaller and faster?
Don Quigg

by dana803

I think this might work. I'm playing around with test tables in a blank database right now to see how. If you can provide me any help in how to get the deleted items to be put in their own table, I would greatly appreciate it. (Deleted items would usually reflect a need for a credit to the customer.)Thanks. dmartin@itechcorporation.com

This discussion is closed to new replies.