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

Output a named Word report

Status
Not open for further replies.

Rainer2000

IS-IT--Management
Apr 27, 2003
61
DE
Hi

when I output a report to Word using the "Office link" button, Access gives it an automatic name. (I think it is always the name of the report).

Is there any way to give it a specific name which is taken from a field?

Rainer
 
Create your own button with "OutputTo" command.
See "OutputTo Method" in the VBA help

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Hallo Zamer,
thanks for the hint. That's the way I made it work.

Dim stDocName As String
stDocName = "ANGEBOT"
DoCmd.OpenReport stDocName, acPreview, whereCondition:="Nr=" & [NR]
DoCmd.OutputTo acReport, , acFormatRTF, [Text220], False
DoCmd.Close

I am not sure if it is 100% correct, but it works.

I also created a field [Text220] in the Form, where I keep the file name.

Thanks again,

Rainer


Rainer
 
Yes that is the way..

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top