B
BTU_needs_assistance_43
I've just finished some code designed to bring Excel files into my Access
Database and after it does it moves old files into a folder called "Processed
Reports". However it has come to my attention that some supervisors will add
data to their reports that is most current, but then go back as much as 2
months later to add new data from recent work to the old file instead of just
making a new report. What I need to do and am having trouble finding is a way
to import recently modified data (thats the easy part with
msoLastModifiedLastMonth) but I need it to do it without adding the old data
from those Excel files again, only the new data. Or if it is going to add the
old data again, delete the old data that was already stored in the Database
and add the new data to overwrite the old with the same data PLUS the new
data. The end result should be I have all the data stored in the Database
with no repeated data.
To import the data I'm using the Application.Filesearch command, then
defining the name of the worksheet within the reports I want the data from
and then having my code read the data by columns until theres no data in the
next column. Then it just dumps it all into my Database and moves onto the
next Excel file.
I assume that I'll have to write in code in the last phase to tell it to
check for identical records, but I'm having a heck of a time finding code to
do this. How do I tell Access to check for identical data, but not just one
line, for a section or column or row because all lines for each chunk will
have the same name in the first cell for each set of files?
Database and after it does it moves old files into a folder called "Processed
Reports". However it has come to my attention that some supervisors will add
data to their reports that is most current, but then go back as much as 2
months later to add new data from recent work to the old file instead of just
making a new report. What I need to do and am having trouble finding is a way
to import recently modified data (thats the easy part with
msoLastModifiedLastMonth) but I need it to do it without adding the old data
from those Excel files again, only the new data. Or if it is going to add the
old data again, delete the old data that was already stored in the Database
and add the new data to overwrite the old with the same data PLUS the new
data. The end result should be I have all the data stored in the Database
with no repeated data.
To import the data I'm using the Application.Filesearch command, then
defining the name of the worksheet within the reports I want the data from
and then having my code read the data by columns until theres no data in the
next column. Then it just dumps it all into my Database and moves onto the
next Excel file.
I assume that I'll have to write in code in the last phase to tell it to
check for identical records, but I'm having a heck of a time finding code to
do this. How do I tell Access to check for identical data, but not just one
line, for a section or column or row because all lines for each chunk will
have the same name in the first cell for each set of files?