Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Import Routine from Excel into Access

Posted on 2001-06-22
4
Medium Priority
?
529 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1200 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

715 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