Inport only updated files from Excel

L

Liver

I am new to Access 3. What I would like to do is keep records for our
church. They are updated almost on a weekly-bases, either they are moving
out, changing phone numbers, address, cells numbers, E-mail address etc.
They will be given to me in an Excel file which has everyone not just the
new or updates. So I have everyone in the member.mdb. The primary key is
MID,which has no duplicates. How do I go out to the Excel file and see if,
name,address,phone,cell,Email has change and update them.

Thanks for any help.
Paul
A.K.A Liver
 
K

Ken Snell MVP

Import the entire EXCEL worksheet into a table. Then write a query that
identifies which data in the table do not match the data in the original,
permanent table. Then write an update query from that query to update the
data in the original, permanent table.

By the way, what is "ACCESS 3"? I'm not familiar with that version.
 
A

Arvin Meyer MVP

The only possible way is to put a timestamp in the Excel file for every row
that's added or edited. That is easy in Access, but perhaps you may need to
ask for some code in an Excel newsgroup.
 
J

John Spencer

Are you duplicating the EXCEL file EXACTLY in a data table? NO
additional fields?

If so, can you just delete all the records in your table and import the
records.

Optionally, assuming that MID exists in the EXCEL table then You would
need one query to ADD new Records

INSERT INTO Access
SELECT *
FROM Excel LEFT JOIN Access
On Excel.MID = Access.MID
WHERE Access.MID is Null

One query to identify (and delete or mark if you want) those that are no
longer in EXCEL

DELETE
FROM Access
WHERE MID IN
(SELECT A.MID
FROM Access as A LEFT JOIN Excel
ON A.MID = Excel.MID
WHERE Excel.MID is Null)

Finally you are going to need to identify records where changes have
taken place.

UPDATE Access as A INNER JOIN Excel As E
ON A.MID = E.MID
SET A.Name = [E].[Name]
, A.Address = [E].[Address]
, A.Phone = [E].[Phone]
....

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top