Output to Excel & make filename be Acct#

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
 
S

Steve Schapel

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
 
S

Susan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top