Macro to update table (1 Viewer)

helpmeee

Registered User.
Local time
Yesterday, 21:17
Joined
Feb 17, 2009
Messages
16
Hey everyone,

I'm working with an excel file that I have to import into an access database twice a week. I have to run a special macro on this excel file before I import it. Once I import it into acess, I want it to replace the past information it has in the table and put the new information in.

I know I need a macro to do this.. but I don't know where to begin? The codes on this website didn't really make sense to me:

http://www.access-programmers.co.uk/forums/showthread.php?t=170272


Can anyone help?
 

ted.martin

Registered User.
Local time
Today, 04:17
Joined
Sep 24, 2004
Messages
743
Several aspects to this:
1- Import the Excel data into a temporary table
2- Validate the data
3- Go through the data line by line and then update the tartegt table
4- Delete the tmp Excel table.

All this can be done through VBA code using DAO.Recordset.
 

helpmeee

Registered User.
Local time
Yesterday, 21:17
Joined
Feb 17, 2009
Messages
16
Several aspects to this:
1- Import the Excel data into a temporary table
2- Validate the data
3- Go through the data line by line and then update the tartegt table
4- Delete the tmp Excel table.

All this can be done through VBA code using DAO.Recordset.

I imported the excel file into a blank table; do I keep all of the data in the file or just the heading/field names?? I don't really understand the next few steps. Could you help?
 

ted.martin

Registered User.
Local time
Today, 04:17
Joined
Sep 24, 2004
Messages
743
You need to use the DAO.Recordset to do all the rest. If you don't know how to do this, then you have a lot of learning to do. Welcome to world of Access and VBA. I suggest you read up and do a few basic things like moving data from one table to another. Once you have done this then you will learn a great deal.

This site is not a "I'll do it for you" . You need to have some knowledge to begin with.

good luck
 

Users who are viewing this thread

Top Bottom