Do the tables have a shared key field or fields that can be used to link
each record in one table to its counterpart in the other?
If so, create a select query that joins (inner join) the tables on the
key field(s) and returns all the fields you want to compare.
There are then two basic ways to go.
1) Write VBA code that opens a recordset on the query and iterates
through it record by record (using MoveNext inside a Do Until ... Loop
structure). Have code inside the loop that compares each field from the
first table with its counterpart from the second and takes action
accordingly.
2) Do it all in the query, by using a series of calculated fields each
consisting of an IIf() expression that compares a pair of fields. For
example, if the tables are aliased to A and B and the field is
date_entered, you might have
..., IIf(A.date_entered<> B.date_entered, "Entry date is different. Old
value was " & Format(A.EntryDate, "dd/mm/yyyy") & ".", ""), ...
Still needing an answer
I have two tables with identical structure but different data.
How can I compare every field in the table to its corresponding field in
the
other table and give a result like :
[Report_no] " Entry date is different. Old value was " [date_entered]