M
mikkl
I am relatively new to VBA programming and would appreciate your help with
what <should be> easy--but with which I am struggling.
I have inherited a database project with two temporary tables. Both of
these are created when a form is run and the final output is saved in Excel
for further manipulation. These tables are then deleted when the
application exits.
One table is dynamically created through a VBA sql call and contains in
excess of 500,000 records. Each of these records has a index value ("IIN")
that identifies the subject of the record. The second table contains the
up to 20 records and contains information for each IIN. There are no
duplicates in the second table.
What I need to do is to assign the records in the second table to each of
the entries in the first table so that I can perform some calculations on
each of the records in the large table.
The code that I have inherited performs a .seek and calculation in a While
loop, but this is incredibly slow and inefficient. (~15 minutes to perform
the calculations on 500,000 records on a 3.5GHz machine)
My thought was that it would be more efficient to populate each record in
the first table with the values from the second table. I can then perform
a very efficient calculation loop.
The problem is, I am not clear on how to best take the values from Table 2
and insert them into Table 1. Assume that an empty column exists in Table
1 for taking the new values.
Any and all help is appreciated,
mikkl
what <should be> easy--but with which I am struggling.
I have inherited a database project with two temporary tables. Both of
these are created when a form is run and the final output is saved in Excel
for further manipulation. These tables are then deleted when the
application exits.
One table is dynamically created through a VBA sql call and contains in
excess of 500,000 records. Each of these records has a index value ("IIN")
that identifies the subject of the record. The second table contains the
up to 20 records and contains information for each IIN. There are no
duplicates in the second table.
What I need to do is to assign the records in the second table to each of
the entries in the first table so that I can perform some calculations on
each of the records in the large table.
The code that I have inherited performs a .seek and calculation in a While
loop, but this is incredibly slow and inefficient. (~15 minutes to perform
the calculations on 500,000 records on a 3.5GHz machine)
My thought was that it would be more efficient to populate each record in
the first table with the values from the second table. I can then perform
a very efficient calculation loop.
The problem is, I am not clear on how to best take the values from Table 2
and insert them into Table 1. Assume that an empty column exists in Table
1 for taking the new values.
Any and all help is appreciated,
mikkl