When no images exist (1 Viewer)

BillyMac

Registered User.
Local time
Today, 10:50
Joined
Feb 27, 2004
Messages
24
I have looked through 18 pages of forums and have not found an example of what I want to do. The help I have received from this forum has been tremendous so far. I have a form with a subform that displays an image and everything works fine. The problem I have is that not all of the records on the main form have images related to them. Where there are no images for that record I want to display a message "there are no images related to this record" in the image field or somewhere like a pop-up message box or something like that. It is probably quite simple for you guys out there but I just can't get my head around it. Any help would be appreciated.
 

WayneRyan

AWF VIP
Local time
Today, 18:50
Joined
Nov 19, 2002
Messages
7,122
Billy,

You could use the form's OnCurrent Event to do
something like:

Code:
If IsNull(Me.PictureField) Then
   Me.PictureField = "C:\SomeFolder\SomePicture.jpg"
   Me.Refresh
End If

"SomePicture" could be whatever image you desire.

I don't have any databases with pictures so this is
just an idea. Maybe this response will bring some
attention from others.

Wayne
 

BillyMac

Registered User.
Local time
Today, 10:50
Joined
Feb 27, 2004
Messages
24
Wayne,

Thanks for that. I will give it a try.

Billy
 

Oldsoftboss

AWF VIP
Local time
Tomorrow, 03:50
Joined
Oct 28, 2001
Messages
2,499
What i have done is to place a label on the form where the image is and set it behind the image. That way, when there is no image, the label is visible.

See attachment for more

Dave
 

Attachments

  • ImageSample2000.zip
    44.7 KB · Views: 2,159

BillyMac

Registered User.
Local time
Today, 10:50
Joined
Feb 27, 2004
Messages
24
Dave,

Tried that but the label is visible when there is an image. I don't have any images embedded in the form they are linked via an image path to a folder on the harddrive. Is there something I have missed

Billy
 

IanMilly

Registered User.
Local time
Today, 18:50
Joined
Jun 1, 2004
Messages
46
BillyMac said:
I have looked through 18 pages of forums and have not found an example of what I want to do. The help I have received from this forum has been tremendous so far. I have a form with a subform that displays an image and everything works fine. The problem I have is that not all of the records on the main form have images related to them. Where there are no images for that record I want to display a message "there are no images related to this record" in the image field or somewhere like a pop-up message box or something like that. It is probably quite simple for you guys out there but I just can't get my head around it. Any help would be appreciated.


you could always just create an image the same size as the other images with the message displayed in it, crude but effective.
 

BillyMac

Registered User.
Local time
Today, 10:50
Joined
Feb 27, 2004
Messages
24
Dave,

Ignore my last message - I forgot about the bring forward send back function on the format menu.

Billy
 

qootea

New member
Local time
Today, 10:50
Joined
Sep 16, 2006
Messages
3
Hi. I am also attempting to display the picture by linking the file like in the example database. What I really want to do is like the Change picture button in the sample database, I would like to have a button which when clicked will open the file window. But when I put the code into my own database the compiler tells me that 'Dim OFN As OPENFILENAME' is user-defined type not defined. What does this mean? How can I fix this problem?

Thank you.
 

Users who are viewing this thread

Top Bottom