Applying specifications to Multiple Imports

  • Thread starter Thread starter Raymond
  • Start date Start date
R

Raymond

I would like to have an import macro that automates the
following events when I click "IMPORT".
The file name is different for each import; currently
using access versions 2000 & 2002.

- navigates to \mydocuments\exposure log..
- sets file type to "txt"( files will auto display)
- I select the file to import
- import process starts
- applies "specifications"( Spec name is "Exposure")
- imports file into specified table

At present, this is a manual process I use for multiple
files each day. I'm not familiar with creating code.
Any help would be greatly appreciated.
 
Check out TransferText in Help file. You can use this method to import text
files via macro or VBA code.

Post back if you have more questions.
 
I've used the transfertext macro and it works fine. The
problem is that the file name changes for each file, for
each import( I am simply collecting data from various
remote units and dumping the info into a folder).
Is there a way to have the transfertext macro"pause", so
that i could select a file to import?
Thank you for the guidance..
 
It's possible to have the macro get the filename (including path, if you
wish) from the user. If you just want to enter (Manually type) the info, you
can use the InputBox function in the filename argument of the macro's
action:

File Name: =InputBox("Enter the path and file name:")


Or you can use a function that opens the "Browse" window of Windows to
navigate to and select the file, and then call that function in the File
Name argument of the macro. The function and associated procedures are found
at The ACCESS Web:
http://www.mvps.org/access/api/api0001.htm
 
Thanks, That should work..
-----Original Message-----
It's possible to have the macro get the filename (including path, if you
wish) from the user. If you just want to enter (Manually type) the info, you
can use the InputBox function in the filename argument of the macro's
action:

File Name: =InputBox("Enter the path and file name:")


Or you can use a function that opens the "Browse" window of Windows to
navigate to and select the file, and then call that function in the File
Name argument of the macro. The function and associated procedures are found
at The ACCESS Web:
http://www.mvps.org/access/api/api0001.htm



--

Ken Snell
<MS ACCESS MVP>




.
 
You could set up some sort of looping that would import all
files in a directory without any user intervention. If you
want some help let me know

Jim
 
I need to do just this, I have approx 150 databases to import into one master
database. I have four tables containing data in each database (all the same
names etc) which I need appending to a master db. I have created a macro
which imports all four tables manually but each db has to be done one at a
time. It is very time consuming and you have to rename the db each time to
the same file name (Tried to do it by getting it to call the code mentioned
in the post but not working so far... might try the inputbox function to
capture the filename if I can't get that to work).
If you could provide help on coding this to loop all
files in a directory, without any user intervention, I would be most
grateful !!! :-)
 
Back
Top