Importing CSV file through Import Wizard but storing filename & location

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Hi all,

I am trying to import a file (which will be different each time, so
cannot use transfertext/transferspreadsheet etc) through a command
button on a form. Currently I have command button that starts the
text import wizard as follows:

CommandBars("Menu Bar"). _
Controls("File"). _
Controls("Get External Data"). _
Controls("Import..."). _
accDoDefaultAction


and it works great, however my problem is that I cannot record the
filename and pathname of the file that has been imported to and the
table it has created so I can put it in my file import log. How would
I record that information?

Regards,

Bob.
 
Hi Bob,

I'd think in terms of using the code athttp://www.mvps.org/access/api/api0001.htmto let the user specify the
file. Then pass the filespec to TransferText or TransferSpreadsheet as
appropriate. Finally append the filespec to the import log.

I am trying to import a file (which will be different each time, so
cannot use transfertext/transferspreadsheet etc) through a command
button on a form. Currently I have command button that starts the
text import wizard as follows:
CommandBars("Menu Bar"). _
Controls("File"). _
Controls("Get External Data"). _
Controls("Import..."). _
accDoDefaultAction
and it works great, however my problem is that I cannot record the
filename and pathname of the file that has been imported to and the
table it has created so I can put it in my file import log. How would
I record that information?

Bob.

--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.- Hide quoted text -

- Show quoted text -

Hi John,

I cannot use the Transfertext/Transferspreadsheet method because I do
not have a filespec, as the file changes each time. That is why I
wanted alternatives... Any other suggestions?
 
Hi John,

I cannot use the Transfertext/Transferspreadsheet method because I do
not have a filespec, as the file changes each time. That is why I
wanted alternatives... Any other suggestions?

TransferSpreadsheet doesn't use a file specification, and TransferText
doesn't need one for a CSV file. What's the real problem?
 
Back
Top