Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Pass a user input file name to an import macro

Status
Not open for further replies.

andyswen

Technical User
Apr 18, 2003
8
US
I need to prompt a user for an input file name and path which I want to then pass to a routine (I have a macro already done) that imports the data into the existing application tables. I can run the macro successfully with a fixed input file name but I need to allow for a variable input file name.

Thanks in advance
Andy
 
One way to do it is to put a text box on a form, and have the user enter the name in the box. I use this to pass parameters to queries and reports all the time.

I haven't done it in a macro, but I'm guessing it works the same way - where you put the name in, just type:

forms![your form name].[your textbox name]

You could have a command button on the form to run the macro.

 
This is much better executed in a Module than a Macro. I have a sample db that opens a Common Dialog box, allows the user to select the file and then stores that in a tezxtbox, where you can use it as the path for an import, export or hyperlink file. Let me know if you want a copy by giving me an e-mail address where I can send it.



"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
A copy would be helpful. You can forward it to andyswen@aol.com

Thanks
 
Could you send me a copy please

jon92@btinternet.com

thanks
 
All your answers and a link to the db is here...

Enjoy

thread702-563930

"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
Can somebody send me a copy as well please...

dinats@yahoo.com

Thank you!
 
Dinats...

Just follow the link above...



"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top