By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

appending new data

P: n/a
This might be a dumb question, but I am pretty new to Access....

I am trying to write code in Access to take river forecasts which are
delivered as attachments in emails and append the data into an Access
Database. Some forecasts are updated 4 times a day and others are
only updated daily. I am trying to write a code which will only
update the new forecasts and not cause repetitive data from the
forecasts that only change once a day. (Some sort of "Append new data
only" query). I have looked at some of the posts on here but I don't
understand enough about access to fully understand what they are
suggesting.
Each record that is entered into my master table has the following
fields:

Created Timestamp (when the forecast was actually made)
Forecasted Date (the date and time the forecast is for)
Value (the actual value of the forecast)

So the Created Timestamp will change with each new spreadsheet that is
sent out even though the forecast will remain the same. I want to
write code so that the forecast will only be appended when the range
of the forecast changes.

I don't know if that makes sense, but any suggestions are welcome.
Thanks

Anna Warloe
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
DFS
Anna,

If the attachments come in via email in a consistent format (ie the same
data in the same place in the same file type) your life will be much easier.
1) set a primary key on your master table, so no duplicate data can be
added. You said it was river forecasts, but I don't see mention of "River"
in your table description.

PK on:
- RiverName
- Forecasted Date (the date and time the forecast is for)
- Value (the actual value of the forecast)

This will prevent duplicate forecasts from being added to your system. Only
the first CreatedDate will be stored in your data.

2) There's probably VB code to mine the attachments directly from the email
(especially if it's MS Outlook), but I don't know how. You can manually
save the email attachments into a "daily forecast new" directory on your
hard drive

3) write VBA code to process each file in the "new" directory, add the data
to your system, then move the files to a "daily forecast archived" directory
Alternatively, you can do all of steps 2 and 3 manually by importing each
email attachment into your database and appending the data to the master
table.


"Anna Warloe" <An*********@PacifiCorp.com> wrote in message
news:e3**************************@posting.google.c om...
This might be a dumb question, but I am pretty new to Access....

I am trying to write code in Access to take river forecasts which are
delivered as attachments in emails and append the data into an Access
Database. Some forecasts are updated 4 times a day and others are
only updated daily. I am trying to write a code which will only
update the new forecasts and not cause repetitive data from the
forecasts that only change once a day. (Some sort of "Append new data
only" query). I have looked at some of the posts on here but I don't
understand enough about access to fully understand what they are
suggesting.
Each record that is entered into my master table has the following
fields:

Created Timestamp (when the forecast was actually made)
Forecasted Date (the date and time the forecast is for)
Value (the actual value of the forecast)

So the Created Timestamp will change with each new spreadsheet that is
sent out even though the forecast will remain the same. I want to
write code so that the forecast will only be appended when the range
of the forecast changes.

I don't know if that makes sense, but any suggestions are welcome.
Thanks

Anna Warloe

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.