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

put image on report and link to picture at run time 1

Status
Not open for further replies.

BitZero

Programmer
Mar 11, 2008
100
US
I'm trying to create a report with a company logo in the report header using Access 2003. When I add the image object to the report header, I'm prompted to browse and enter the name of an image file. Is there a way to leave the picture name blank at this point? I want to set the picture name in the report on open event with code like this:

Image1.Picture = CurrentProject.Path & "\CompanyLogo.bmp"

The picture type is "linked".

The problem I'm having is that when the image control is added to the report header, I have to enter a picture name, like c:\myDir\dummyimage.bmp. Then if I move my database to a different computer that doesn't have c:\myDir\dummyimage.bmp, I'll get an error message when access is started that says it can't find c:\miDir\dummyimage.bmp.

I'm doing a similar thing on several forms, but when you do an image on a form, you can enter "(none)" for the picture name.
 
In that thread it says:

Now create an IMAGE object(call it PictureImage) using the IMAGE tool from the toolbar. ACCESS will prompt you with a Common Dialog box to path to the location of a picture document. Go ahead and select any picture(.bmp, .jpg, etc) it doesn't matter which one because we are going to remove this link. Now in your report right-click the new image object and select Properties. There is a Property called Picture which has the pathway to the picure you just selected. Highlight the pathway and delete it.

However, when I "highlight the pathway and delete it", the pathway comes back. I can't delete it.
 
How are ya BitZero . . .

Complete the selection of an intended graphic file, then [blue]delete the path & filename in the [purple]Picture[/purple] property![/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks AceMan, that worked! It's weird, because I thought I had tried that before and the path and filename wouldn't go away. This time I got a message that asked if I really wanted to delete the name. I said yes, and it replaced it with "(none)", which is what I wanted. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top