DLookup problem

See attached with two images. What you're trying to do can only work in Single Form. If you want to hide it automatically (in any view, i.e. Continuous or Single) then you need to use an Attachment control and set its Control Source.

On record 22 that's when both images get displayed at the same time.
 

Attachments

See attached with two images. What you're trying to do can only work in Single Form. If you want to hide it automatically (in any view, i.e. Continuous or Single) then you need to use an Attachment control and set its Control Source.

On record 22 that's when both images get displayed at the same time.

Yep, that's what happening.

So, image control source doesn't work like textbox control source. The textbox is doing it correctly--it's just not the image I want.
 
There's nothing wrong with the Control Source. You have an attachment datatype, if you want to display a picture, you use an Attachment control, not an Image Control.

If you have an OLE field, you use an OLE control to display the image.

The attachment field is returning an attachment which isn't compatible with the Image control.

Use the right controls for the right datatypes.
 
There's nothing wrong with the Control Source. You have an attachment datatype, if you want to display a picture, you use an Attachment control, not an Image Control.

If you have an OLE field, you use an OLE control to display the image.

The attachment field is returning an attachment which isn't compatible with the Image control.

Use the right controls for the right datatypes.

Nope, that's not what I want.

I'm trying to do display a paperclip image if the record has images attached therefore you won't have to open the image to see if any images are attached.
 
Luckily you have 2007.

The only is to use an IIF() to return the path of the clip image if there's a picture or return a zero length string. Either you do that in the query and use the alias field as the Control Source, or you put the IIF() function directly in the Control Source. My preference would be in the query.
 
Luckily you have 2007.

The only is to use an IIF() to return the path of the clip image if there's a picture or return a zero length string. Either you do that in the query and use the alias field as the Control Source, or you put the IIF() function directly in the Control Source. My preference would be in the query.

Are you saying like: =IIf([EventAttachment] Is Not Null,".",Null)
 
In query:
Code:
AliasName: IIf(Nz([EventAttachment], "") <> "", "C:\Users\Administrator\Desktop\ClipIcon.bmp","")
Use =AliasName in control source

OR

In Control Source directly:
Code:
=IIf(Nz([EventAttachment], "") <> "", "C:\Users\Administrator\Desktop\ClipIcon.bmp","")
 
In query:
Code:
AliasName: IIf(Nz([EventAttachment], "") <> "", "C:\Users\Administrator\Desktop\ClipIcon.bmp","")
Use =AliasName in control source

OR

In Control Source directly:
Code:
=IIf(Nz([EventAttachment], "") <> "", "C:\Users\Administrator\Desktop\ClipIcon.bmp","")

Nope, tried both--didn't work.

I know there were a discussion on images a while back but I can't find the post. I think that's why they had me to use the text box with Winding.
 
See attached. Watch how the image control displays the paper clip image in the folder.

Unzip and run the db from the same folder as the image.
 

Attachments

See attached. Watch how the image control displays the paper clip image in the folder.

Unzip and run the db from the same folder as the image.

Okay, tried it but when I added an image to 23, the paperclip didn't appear.
 
All the form needed was a requery. Open the form, add an image in the table (remember to move away from the record so it saves), requery the form and see if that helps.
 
I don't want to add another table or revised the table and try to explain to someone else why I am doing this when I really don't know.

Using the text box with this code in the ControlSource works: =IIf([EventAttachment] Is Not Null,".",Null)

I don't know why doing the same in the image ControlSource does not. Maybe it's a bug in the program or our program.

Anyway, I will just use the textbox with an asterik.

Thanks!
 
Who mentioned adding a new table or changing the structure of your table? Did you look at the example database I took my time to do and posted?

I had tested it before posting it to you and it was certainly in the Control Source property. The image was in the folder, not in the table. There's really no bug.

It's up to you however way you find easier.
 
Who mentioned adding a new table or changing the structure of your table? Did you look at the example database I took my time to do and posted?

I had tested it before posting it to you and it was certainly in the Control Source property. The image was in the folder, not in the table. There's really no bug.

It's up to you however way you find easier.

I'll look at it again tomorrow are around noon--I am too tired--and it's in th wee hours--got to get up in 6 hours and start it all over again.
 
Study it properly. Look at the query and see that all it's doing is referring to the path where the picture is located. An image control, recognises the path via the control source and displays the image associated to that path. This is a tried and tested way of doing this.

Let me know if you require anything explained.

Good luck.
 
Study it properly. Look at the query and see that all it's doing is referring to the path where the picture is located. An image control, recognises the path via the control source and displays the image associated to that path. This is a tried and tested way of doing this.

Let me know if you require anything explained.

Good luck.

Went back over it. Now it makes sense. It's working. Whoa, that took a while. Now I can get a few zzzzzz. Later.

THANKS!
 
Study it properly. Look at the query and see that all it's doing is referring to the path where the picture is located. An image control, recognises the path via the control source and displays the image associated to that path. This is a tried and tested way of doing this.

Let me know if you require anything explained.

Good luck.

Once again vbaInet, thanks a lot! When you see the actual db it makes a big difference. Now, I feel like I accomplish something for the day.
 
It's always good to thoroughly look into a possible solution before giving up.

Glad we got that working for you.
 

Users who are viewing this thread

Back
Top Bottom