Macro-Transfertext-Filename using input from form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to use a Macro/Transfertext to import a csv file. It has a tree
associated with it: c:\Data\filename.csv I would like to substitute
filename with a textbox parameter from a form. Is there a special format
I must use or is there another way I must go? Thanks for the help!
 
Use this instead of the path & filename: [Forms]![NameOfForm]![NameOfTextBox]

This assumes that the form is open and that the control on the form contains
the entire path & file name.
 
Brian,
This would make the user enter the complete tree name and file suffix every
time. Through some pain I came up with a format that works. In the Macro
where I select Transfertext as the action, I use the following arguments:
"c:\Data\" & [FORMS]![Formname]![TextboxName] & ".csv"
This allows the user to only type the filename and not worry about the tree
path (which is longer than I show above). They don't even have to put the
..csv on the end. I appreciate the option but I did manage to hit this one.
Perhaps you or someone else could benefit from this. Thanks again for the
reply!

Brian said:
Use this instead of the path & filename: [Forms]![NameOfForm]![NameOfTextBox]

This assumes that the form is open and that the control on the form contains
the entire path & file name.

Rickm said:
I would like to use a Macro/Transfertext to import a csv file. It has a tree
associated with it: c:\Data\filename.csv I would like to substitute
filename with a textbox parameter from a form. Is there a special format
I must use or is there another way I must go? Thanks for the help!
 
Brian,
Actually, the Arguments in the other reply go in the Filename area of the
Argument listing just for clarification.

Brian said:
Use this instead of the path & filename: [Forms]![NameOfForm]![NameOfTextBox]

This assumes that the form is open and that the control on the form contains
the entire path & file name.

Rickm said:
I would like to use a Macro/Transfertext to import a csv file. It has a tree
associated with it: c:\Data\filename.csv I would like to substitute
filename with a textbox parameter from a form. Is there a special format
I must use or is there another way I must go? Thanks for the help!
 
Back
Top