Solved

Import Routine from Excel into Access

Posted on 2001-06-22
4
507 Views
Last Modified: 2006-11-17
Does anyone have a generic import routine from Excel into Access? I am receiving a file in xls format weekly. What I would like to do is to name the file as file062201.xls (today), file062901.xls which would be the file I receive next week. I am going to save these files into one directory. I am looking for a generic import routine that would grab the data in excel and import into Access. This will replace any existing data in the table (as opposed to appending). Please help.
0
Comment
Question by:ay3314
  • 2
4 Comments
 

Expert Comment

by:Mikeh
ID: 6220413
1. you can link excel tables into access.  given you know the directory and file name then you can code this.

2. having linked the spreadsheet you could either run a query to replace the table data or do it in code.
0
 

Author Comment

by:ay3314
ID: 6222967
But that's what I am looking for - code!!
0
 
LVL 19

Accepted Solution

by:
frankytee earned 300 total points
ID: 6223281
ay3314, you've posted this question twice. you may as well delete this question and save 300 pts.

see my post at:
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20140875

0
 

Expert Comment

by:Mikeh
ID: 6232450

sorry for the delay

here's some code

DoCmd.RunSQL ("delete * from accesstablename")

DoCmd.TransferSpreadsheet , acImport, accesstablename, "ExelPath",True(hasfieldnames)/False(doesnot),range"
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question