Help! - Importing data from excel to Access

  • Thread starter Thread starter Andyj101
  • Start date Start date
A

Andyj101

Guest
Help! I need to write a routine for importing data from excel to access.
The field names are the same in excel and access they are as follows:
Measurement ID
Assessment ID
Time
Measurement Name
Measurement

Does anyone have any ideas??
 
If you're using Access '97
Investigate TransferSpreadsheet method.
 
I have a similar problem, but I don't want to hard code the file path, I want to check for the existence of the file at a fixed location (c:\windows\Desktop\FileName.csv) and if it present then run an append to table query to add it's contents to a table. If it is not there, then I'd like to give the opportunity to canel or search for the file.

After a succesful import, I'd like to be able to automatically delete the file from the desktop.

I'm Ok with the import & appending bit but the rest is Rocket Science as far as I'm concerned. Any suggestions gratefully received!
 
JoysTick

If you create a textbox on a form and enter your path in there i.e. c:\windows\Desktop\FileName.csv
In your procedure create a Dim i.e.
Dim Path

Path = YourForm!YourPath

If Dir(Path) <> "" then
Your Code to import the Data
Kill Path ' this will delete the file
Else
Something here to browse for the file

Hope that helps in determining whether the file exists and deleting it afterwards now all you need is the browsing bit. If you get it working I'd be interested in seeing the code.

Cheers

John
 

Users who are viewing this thread

Back
Top Bottom