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

Publich to word - single record

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
Hi,

I have a report which is generated from a form. The form filters the report to show just one record. IO use the following code to do this:

Code:
    Dim stDocName As String
    Dim stLinkCriteria As String
   
     
    stLinkCriteria = "[ID]=" & Me![ID]
    stDocName = "Rep_ReferralFormPM_FPM"
 
    DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria

My aim is to output this report (with the single record) to Word. I know that i could use a mailmerge to do this, but I want to get away from having dedicated word document for the output (i update this quite frequently and it's easier if i only have to update the database as opposed to updating the database and a word document)

Hope this is clear, can anybody help?
 
Once your report is in print preview mode, go to Tools, Office Links, Publish with Word.
 
Hi,

It's ok, I've solved the problem. I just had to put a filter on the report so it only shows the current record from the form

Code:
ID =[Forms]![Referrals Edit]![id]

I then used the output to method as suggested by mp9:
Code:
DoCmd.OutputTo acReport, stDocName, acFormatRTF, stNewDocName, True

seems to work OK. Thanks for the pointer



seems to have done the trick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top