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

how to creat a event that will open a report as a rtf or doc

Status
Not open for further replies.

Poobear1929

Technical User
May 11, 2004
32
US
I was wondering if anyone knew how to write an event that on opening of a report it will display it in word or rtf format instead of access. I am trying to use the following code but I get runtime errors.

Private Sub Report_Open(Cancel As Integer)
DoCmd.OutputTo acOutputReport, "unit Report", acFormatRTF

End Sub


Thank you to anyone how can help me

Poobear
 
add this to the code that opens the report. instead of opening the report this outputs it to unit Report.doc then opens it with ms word.

DoCmd.OutputTo acOutputReport, "unit Report", acFormatRTF, "C:\unit Report.doc"
Call Shell("winword.exe c:\unit Report.doc", vbNormalFocus)
 
Instead of DoCmd OpenReport, ...
DoCmd.OutputTo acOutputReport, "unit Report", acFormatRTF, "\path\to\unit.doc", True


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top