Output to Excel & make filename be Acct#

  • Thread starter Thread starter Susan
  • Start date Start date
S

Susan

I am using a macro to output a table to Excel and I want
the file name to be the Account Number for that Client
into a certain directory. This is either a 4 or 5-digit
number.

Can I make the "Output File" be a literal path (ex:
c:\audit\) and the filename after that be the Acct # for
that file, either from a form or table maybe? Can this
even be done from a macro or does it have to be done with
code? This number is in one of the fields of the table
being exported or it is on the form that runs the macro
if needed.

Thanks!!
Susan
 
Susan,

Presumably you are using a TransferSpreadsheet macro. In the File
Name argument, put the equivalent of...
="C:\audit\" & [Forms]![NameOfYourForm]![AcctNo] & ".xls"

- Steve Schapel, Microsoft Access MVP
 
Thanks Steve! It worked perfectly!!!
-----Original Message-----
Susan,

Presumably you are using a TransferSpreadsheet macro. In the File
Name argument, put the equivalent of...
="C:\audit\" & [Forms]![NameOfYourForm]![AcctNo] & ".xls"

- Steve Schapel, Microsoft Access MVP
 
Back
Top