Import with variable filename

millercj

Registered User.
Local time
Yesterday, 19:29
Joined
Jan 20, 2009
Messages
18
Hi all, I'm trying to import a series of csv files with the TransferText function. It works fine but I'm trying to make it so the user can browse for a file. I've done such using an activex control and it successfully throws the directory and filename into a text box. When I click my import button (which is to run the macro) it does nothing. I changed the filename field in the macro to [Forms]![Import]![MainCSV] rather than "C:/........" in hopes it would work, but alas it does not.

How would I do this?
 
It would work for sure if you use VBA code instead of a macro.

Check the VBA help on DoCmd.TransferText command. This would give you full control over the filename. For a start you could "save as..." your macro as a VBA module, what might work right away (I never tried something like [Forms]![Import]![MainCSV] in a macro).

HTH
Thomas
 

Users who are viewing this thread

Back
Top Bottom