Finding Groups of Matching Values

  • Thread starter Thread starter google
  • Start date Start date
G

google

Hi, All,

I have two tables of data in MS Access 2000. In VBA, I would like to
extract groups of values from a column in one table that add up to a
value from another column in another table.

In other words, if I have Table A and Table B, I would like the VBA
code to examine the first value from Table A (let's say it's 10) and
find any groups of values from another column in Table B that add up
to 10. Then the code automatically goes to the next line in Table A,
finds a value of, say, 38, and finds values in Table B that match that
one (38 or 37+1 or 3+8+20+7, etc.) and so forth.

Can this be done?

Thanks,



LanceP
 
When you find the record combination then what is to happen? Flag the
records as being used? Append records to TempTable?
 
When you find the record combination then what is to happen? Flag the
records as being used? Append records to TempTable?

Hi,

Thanks for responding. We're making multiple passes through the
recordsets, attempting to find the matches and differences (this is an
accounting reconciliation procedure). So, if we find matches, we'll
mark the records as matched. These records will be overlooked in
subsequent passes until all the data has been verified. After that,
we'll query for records marked as matched versus those marked as
differences and export them to different spreadsheets for analysis.

Cheers,


LanceP
 
Back
Top