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

Image on Report using a DLookUp 2

Status
Not open for further replies.

cimoli

Technical User
Jul 30, 2010
207
0
0
US
I used to embed a logo on the report letterhead. But I decided to make it dynamic in case I have a 2nd Store front which
would use a different logo on the report letterhead.

In the image box on the report, on the 'picture' line, I took out the reference to the old embedded logo.
I went up to the blank Control source line and put in :
=Space(0) & DLookUp("[Logo1]","QryStorePick","[StoreID]=[forms]![frm5035Reports]![cboStoreID]")

I have a table tblStore which has a field name Logo1 that contains the Bitmap. I used bmp.

On a form frm5035Reports, i select a few things, including which Store i am using for the next letter.

I thought the dlookup above would do the job and give me a different logo depending on what
StoreID that i picked in frm5035Reports. I only get a blank Logo when i print preview the letter.

What am I doing wrong? Thanks.

 
use code to set the picture property of an image control.
Since 2007 there is absolutely no reason to use code anymore. Use a bound image control, save the path, and you are done.
 
Maj: Yes, I knew somewhat about that. I thought I invented something, ha. Guess not.
In my other situation, I used a bound image control like you said.
I am having trouble connecting my 3 or 4 tables on this one.
Maybe I need to go thru my tables again and try to get the Logo1 field to talk with
the other tables. Thanks to you and Duane, I know now to abandon my dlookup method to get the picture.
 
Sorry, I was not clear. You do not have to add the field to your query. Make the logo a subform and use a bound image control. Store the image path as a field in your "settings" table.
 
However, I do think (untested) you can actually use a dlookup as a control source and returning the path and using a bound image control
 
I redesigned my qry. Glad I did, thanks. I am back to having the bmp image stored in a table field.
I did away with the dlookup and fixed my qry.

There is something that i don't follow. I would like to avoid putting the true path of the image since my
friend seems to crash her computer alot and gets new ones, and files are lost or put in different places.

Whereas, if i can store the image in a table, it would stay in the Access file.
I seemingly get the images field into the query. But when i am on report, and i refer to the image,
I made a box on the report that the property sheet says .... selection type: IMAGE.
The name is image295. i tried to use the control source linge as LOGO1 which is a field in the query.

I am hoping that i do not need to make a Path. I am hoping that an image inside a query field will
allow a report to use it somehow ? If it can, HOW ?

Thanks alot.
 
6/4/14 I'm still trying to figure out how to get my Report logo field to use the logo field in the qry.

The qry has just the desired one record that has the necessary report fields.
One of the fields is called Logo1.

In the report, I have an image box. I have the Control Source as Logo1.
(I am trying to avoid using specific directory code.)

The picture type says Embedded and the Picture says none.

Did I put myself on a goose chase? Can i get the logo work without stating a path ?
I would like the logo to be Inside the Access file. I don't have many pics to worry about size.

Can you advise? Thanks. If you would like a sample to test, i can make one.
I will let MajP say if it is OK or not.
 
I figured out my last need. In order to get the table field Logo1 to appear in my report,I had to do the following:

1 - I opened the report in design view.
2 - In the Design tab, in the Tools group, click Add Existing Fields. I had been copying an
existing field and that was my mistake i guess. So i hit the existing fields button which
and dragged it to my report.
3 - took off the label.
4 - finally, i right clicked on the new field and in properties, border style, i made it transparent.

Probably sounds basic to you.
But I didn't know to hit the Add Existing field button.
I tried to do manually and couldn't get it to work for some reason.
Now it works. thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top