Setting report properties - remove linked image via code

neilwebber

Registered User.
Local time
Today, 05:49
Joined
Aug 19, 2002
Messages
35
Hi
Not really sure whether this qualifies for the Reports or Code forum?

I have a report with an Image object which has a 'Picture Type' property of 'linked'. The 'Picture' property of the Image object is set to the appropriate path via code on the Report_Open event. What I'd like to do is set the 'Picture' property back to none (ie remove the link) when the report is closed. I do a similar thing on a form with the simple code (on a button)

Me.ImgPlan.Picture = none
Close the form etc etc.....

However, I just can't get it to work on a report. The Report_Close event doesn't seem to allow this to happen and I can't figure out where else to trigger the code from (there doesn't seem to be an event that occurs before the Report_Close).

I want to do this because having a linked picture in a report seems to cause some strange behaviour - just holding the cursor over the name of the report in the database window causes the pop-up box that appears when the image is loading normally ('Importing filepath.jpg' and the blue progress meter)

Any suggestions are most welcome, including the obvious solution that I've no doubt missed.
thanks
Neil
 
I've spotted the deliberate mistake!
I added the first picture manually in the report properties and then set up code to change the picture depending on the record shown in the report.
Just leaving the 'Picture' property as '(none)' to begin with and then adding a picture via code means that the 'Picture' property defaults back to '(none)' when the report closes.

Obvious really.
Amazing what a new day and a clear head can do.
 

Users who are viewing this thread

Back
Top Bottom