My application has a table that contains information on buildings. The
building data comes from another database and is imported from a spreadsheet
into my application.
Originally, I thought that when a building data update is available, I would
simply delete the existing data and import the new data into the table.
However, now it seems that there may be a requirement to keep the historical
data.
Of course there is mountains of code now that goes against the building data
table. The table currently is not setup to maintain historical data.
I'm considering the following as a simple fix:
1) Add a data/time field (ImportDate) to the table and the table primary key
which will track the date the building data was imported into my application.
2) Rather than go through and change the code, instead create a query or run
a query everytime the front end opens. The query will simply select all
records from the building data table where ImportDate is the most recent or I
guess I would use MAX.
3) Rename the current building table and name the query with the name that
the building table currently has. That way all code will go against the query
and not the table.
Here's my problem. I've never created a query in code. I'm not even sure if I
have to. I think I can create a query in the dbWindow that just looks for the
maximum Import Date and then gets all records with that date. This would be,
then, the most current data for all buildings. If so, would I need to run the
query explicitly in code or will Access automatically do this every time the
app opens (I think Access will automatically handle this).
Before I spend a lot of time I would like some domments, suggestions, etc.
Thank you.
--
Message posted via http://www.accessmonster.com