Import Macro - File Location Prompt

  • Thread starter Thread starter seven_percent
  • Start date Start date
S

seven_percent

I have an import macro which runs multiple instances of Transfer Text
on a fixed width flat file using specifications. There are 26
different specs, one for each table that I need the data imported into.
Using =InputBox("Enter the path and filename:") for the filename
works great, for ONE Transfer Text statement. However, all 25 other
transfer statements use the same file, just different specs and tables.
Is it possible to set a parameter in the beginning of the macro like:

myInputFileName = InputBox("Enter the path and filename:")

and then use myInputFileName for the remaining Transfer Text
statements?
 
Seven

On the form from which the macro is activated, put an unbound textbox,
where the user will enter the file path, before doing the imports. In
your macro, in the File Name argument, put a reference to the textbox,
using syntax such as
=[Forms]![NameOfForm]![NameOfTextbox].
 
Back
Top