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!fna me (Is this part possible)
Thanks
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!fna
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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