Link to home
Start Free TrialLog in
Avatar of swimtech
swimtech

asked on

Can I pass a text box variable into an Access Macro

Can I take a varible created by a text box from a form and input it into the TransferSpreadsheet file location in a Macro.  Can I do that in VB is it cannot be done within the macro itself.

Example:  Form Input:.  User puts a file name in a text box. (this is the file he is nameing for a report).  The text box is call fname.
Macro Test: TransferSpreadsheet:
                    Export
                    Excel 2003
                    Table name: RPT
                    File: C:\Reports\Forms!Input!fname  (Is this part possible)
Thanks
ASKER CERTIFIED SOLUTION
Avatar of leonstryker
leonstryker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of swimtech
swimtech

ASKER

Leon
Thanks -- Works perfect!   I put htis code under On_Click for my run button.  On the form I give the user a choice to Print to Printer and/or Print to Excel.  Pritn to print was no problem but I wanted the user to be able to name the file something they would remember.  This works great.  Thanks you