Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / May 2005

Tip: Looking for answers? Try searching our database.

How can I automate the importing of text files into access?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Few - 10 Mar 2005 14:27 GMT
I have been trying to write a macro that will automate the transfer of data
from text files into tables in access. So far I have found two ways of doing
it, but neither are exactly what I am looking for.

The first way is to use the sendkeys function to open the get external data
option, but this means that users will have to go through several menus and
this is what I'm trying to avoid.

The other is to use the Transfer text function, but this seems to limit me
to opening one file, I tried to have a text box that users could enter the
file path into, but access doesn't acept this.

Is there any way of importing the data as with the transfer text function,
without having to specify the exact path (maybe just specifying the folder
and bringing up a box that lets the user choose the file they want to import?

Thanks in advance for your help.

Tim
Ken Snell [MVP] - 10 Mar 2005 14:39 GMT
If you want to let the user navigate to a file, then you cannot do this with
just a macro. You'll need to use VBA code to display the navigation browse
window.

The ACCESS Web has VBA code that displays such a window:
www.mvps.org/access/api/api0001.htm

You would need to put the code in a regular VBA module, then you can call
the function from the TransferText macro by putting the function name (with
the parentheses) in the File Name argument box. (You may need to put = sign
in front of the function name, too.)
Signature


       Ken Snell
<MS ACCESS MVP>

>I have been trying to write a macro that will automate the transfer of data
> from text files into tables in access. So far I have found two ways of
[quoted text clipped - 19 lines]
>
> Tim
Seikyo - 30 May 2005 03:36 GMT
How can we put this module into a transfertext macro?

I tried this but it say "Cannot import this file"

ahtCommonFileOpenSave(Filter:="Text Files (*.text)", "*.txt",
OpenFile:=True,DialogTitle:="Please select an input
file...",Flags:=ahtOFN_HIDEREADONLY)
Signature

Seikyo

> If you want to let the user navigate to a file, then you cannot do this with
> just a macro. You'll need to use VBA code to display the navigation browse
[quoted text clipped - 30 lines]
> >
> > Tim
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.