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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Have form to run a macro but enter the file & table name on the form

Status
Not open for further replies.

chris9

Programmer
Feb 11, 2003
32
US
I want to automate the process for someone to convert text file to an access file where the table is automatically created with the proper headings and widths. I've created a macro that used import text, fixed widths, if the file and table name are entered in the macro it works fine. However, I want to simplify this task for other users. I plan on creating a form in which they enter the table and file name in the form and upon submitting this it is passed to these values to the proper categories into the macro. My problem is that I do not know anything about programming in vb and so I need help passing these values in from the text boxes on the forms to the macro information.
Thanks in advanced for helping.
Chris
 
Chris,

One way is to make the form with your variables. Am I assuming correctly that your calling a macro and want as little VBA coding as possible...?

You can set the form with abutton to call the macro and have the macro fields like this:

(File Name) =[Forms]![Form1]![Text0]
(File Path) =[Forms]![Form1]![Text2]


Jeremy
 
Jeremy,
When I do this, I'm getting an error when it tries to read in [Forms]![Form1]![Text2] that says this is an invalid name but I am not getting that message for the other one. Any suggestions for this might not work?
 
Jeremy,
I got it to work. Thanks so much for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top