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

Outputting to file; using a report; &retaining the images in report

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
GB
Hi all,
Thank you for all the help! [smile]

I have a Form (ChsRef) with a combo box that you choose an option;

Then the user clicks on a cmd button that will output a report (HcnyCrgDri) to a file (any format the user chooses)

The problem I am having is this:

The output works fine; except for one thing; it does not output the template images;
For example to an rtf file.

I have configured the report and linked the image rather than embedded (which I tried first; but with no joy).

Is there any way to force an image transfer to an output file?

Here is the code for the button:
Code:
Private Sub HnkyCrDriCrd_Click()
On Error GoTo Err_HnkyCrDriCrd_Click

    Dim stDocName As String

    stDocName = "HcnyCrgDri"
    DoCmd.OutputTo acOutputReport, stDocName
    
    
Exit_HnkyCrDriCrd_Click:
    Exit Sub

Err_HnkyCrDriCrd_Click:
    MsgBox Err.Description
    Resume Exit_HnkyCrDriCrd_Click
    
End Sub
Any help will be very much appreciated [bigsmile]
Kind regards
Triacona
 
Hi all,

If it is possible; could I also find out how to specify where the rtf file is stored?

I would also like to know how to name the file with a field, i.e. REFVAL from the query ChsRef

Thank you [smile]
Any help would be greatly appreciated [thumbsup]
Kind regards
Triacona
 
Hi all,

The code for the 2nd question is:
Code:
Private Sub HnkyCrDriCrd_Click()
On Error GoTo Err_HnkyCrDriCrd_Click

    Dim stDocName As String

    stDocName = "HcnyCrgDri"
    
    DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, [Forms]![ChsRef].[Combo0]
    
    
    
Exit_HnkyCrDriCrd_Click:
    Exit Sub

Err_HnkyCrDriCrd_Click:
    MsgBox Err.Description
    Resume Exit_HnkyCrDriCrd_Click
    
End Sub
I keep getting an error:
Microsoft Office Access can't save the data to the file you've selected
It works if I specify a static name:
Code:
"Report1.rtf"
But if I put .rtf at the end of the field call it gives me another error:
Object doesn't support this property or method
Any help would be greatly appreciated [bigsmile]
Kind regards
Triacona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top