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

Error when displaying bound ole object (picture) in report.

Status
Not open for further replies.

brianscacr

Programmer
Jul 20, 2005
3
US
I am using the DisplayImage subroutine that is posted in the Microsoft KB Article 285820. It works fine to bring in a jpg image on the report.

The issue occurs when viewing the report. If you try to scroll through the pages on the report to quickly, you get an error : -2147417848 Method 'Picture' of object '_Image' failed.

It is like the report is not creating the actual control before assigning the path of the picture to it.

Any ideas on how to work around this?
 
Briansacr,
I had the same thing, I just put a simple delay in the Format event of the group where the Image existed (Detail, in my case).

You can have a datetime variable and have a doevents loop until, say 2 seconds passed. I prefer to use the GetTickCount api, it gives more granularity--I can pare down the delay to a more precise amount, but either way, the delay loop worked for me. Of course it slows down the report, but at least it prints without crashing.
--Jim
 
I tried this, but it still did not work. Even with a 2 second delay. The images are in a group header. I don't know if that would make it act any differently.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top