Solved

Use of the function TransferSpreadsheet

Posted on 2008-10-26
4
386 Views
Last Modified: 2013-11-27
Hi Experts,

I've previously set up and been running an upload using a csv file and the TransferText routine. I've noticed problems in that the data is delimited by comma and in SOME fields, the person entering the data has seperated part of the data in the one field by comma also. eg- "Bill of Life, The"

I thought of saving the file as a spreadsheet and then using the TransferSpreadsheet routine instead. I'm importing this manually and it works perfectly. I've got no experience however in using the actual TransferSpreadsheet routine. The range of cells will probably differ everytime the upload process is used.

Could you please advise how to use the TransferSpreadsheet routine? Here's a copy of the TransferText line I was using..

 DoCmd.TransferText acImportDelim, "ImportSpecificationRegistered", "tblSTARUploadRegistered", "S:\Secured Folders\Audit\RAMS training\Test Database\STAR Data\Input\Registered.xls", True

Thank you.
0
Comment
Question by:jammin140900
  • 2
  • 2
4 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 22809204


DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,               "tblSTARUploadRegistered", "S:\Secured Folders\Audit\RAMS training\Test Database\STAR Data\Input\Registered.xls", True, "NameOfSheet!"
0
 

Author Comment

by:jammin140900
ID: 22809365

Thanks for the code. I've tried it and getting an error message that one of the fields in the destination table doesn't exist.

I imported this table manually and everything was fine, but when I use this function I get the problem mentioned above. Any ideas please?

Regards
Jammin.
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 22809400
normally if the fields or column names changes and column number varies, it is better to import to a new non existing table. { temptable }

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,               "tempTable", "S:\Secured Folders\Audit\RAMS training\Test Database\STAR Data\Input\Registered.xls", True, "NameOfSheet!"
0
 

Author Closing Comment

by:jammin140900
ID: 31510156
Thank you for your help with this. Much appreciated.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now