Embeding image in form that isn't linked to the underlying data

chuckcoleman

Registered User.
Local time
Today, 13:18
Joined
Aug 20, 2010
Messages
380
Hi, I have a form that I call the AdminForm. It allows the user to store administrative information about the business; business name, address, telephone number, etc. I also have as a part of the table that stores this information an Attachment Field where an image of their logo is stored in a field called, [Logo]. No problem here. The issue is that I want to use the [Logo] field elsewhere like in reports. I've added an Attachment type control to the report and I've used DLookUp to use the image stored in the admin table, but it doesn't display on the report. There isn't any relationship between the admin table and any report so I can't join them unless I do something "unnatural" by adding a fictitious field to every record to tie it back to the key field in the admin table, (there is never more than one record in the admin table; I ensure that). That doesn't seem like the right way to accomplish this.

What do you recommend?

Thanks,

Chuck
 
Instead of using the attachment data type, use an ole object. You can directly reference the Ole object in form and report controls.
 
Thank you billmeye. In the table I added an OLE field. In the for I used a Bound Object Frame. When the form is in the Form View it doesn't display the image; it displays the name of the image with a small icon above it.

In the report when I use DLookUp for the field name, all I see is a box with a border, but no image.

What am I doing wrong?

Chuck
 
It doesn't work with Dlookup, it has to be in the underlying record source so try adding it to the query. As far as displaying as an icon in the form, go into design view, select the control and in the property sheet data tab, you will see Display Type, select Content.
 
Rather than storing the image in the db, have you considered storing it on the network and in the db table have a field that stores the path to the image? Lets call it imgPath.

On your form, bring through the imgPath field in your recordsource and have an image control (not ole) with the control source set to =[imgPath].

This will save bloating the db and has the benefit of working in continuous forms and reduces issues if you ever need to upsize your db.

Dlookup as you are trying to use it wont work but if you are looking up the path, it will
 
CJ London, thank you for your feedback. I am aware of how an Access db can become bloated if you store a lot of pictures. In this case I'm only storing one picture which is the companies logo. In another system I built I used hyperlinks and some code to be able to pull up many images associated with many records. I still want to use the db to store one image and I'm having trouble after changing the field type to OLE getting it to display in a form. Once I figure that out/get help on that issue, I'll tackle getting the image to show up in reports.

Thanks,

Chuck
 
Chuck - have you resolved this? If so, please share. I need to do the same. Thanks!
 
Ms Kathy, I have not. It's still an open item for me. Unfortunately, I have not had the time to work on it so I haven't figured out what my strategy should be and how I'll deal with this.

Chuck
 
I've attached a small DB showing the use of an OLE Object. You should store BMP images as that is what is native to Microsoft otherwise you would need to ensure there is an OLE engine for other types but if your unsure, try it and if you see your image than you have that engine. You could also store actual files, excel, pdf etc. in an OLE Object. If space is a consideration, separate the table that contains the OLE into it's own back end and link to it.

As I said earlier, you can't use an OLE object in a Dlookup but you can add it to a query and use it that way to view it in a report.
 

Attachments

Users who are viewing this thread

Back
Top Bottom