Default Image (1 Viewer)

SteveClarkson

Registered User.
Local time
Today, 07:16
Joined
Feb 1, 2003
Messages
439
Hello,

I have a picture frame in one of my forms that the user can add a picture to if they desire. However, is there a way of making it display a "default" picture if there is no picture defined?

The code is:

Code:
    If Not IsNull([PicFile]) Then
    [imgPicture].Picture = [PicFile]
    SysCmd acSysCmdSetStatus, "Image: '" & [PicFile] & "'."
  Else
    [imgPicture].Picture = ""
    SysCmd acSysCmdClearStatus
  End If
  Exit Sub

Could I just put the path to a default picture in the
Code:
Else
    [imgPicture].Picture = ""
bit???

Thanks!
 

chenn

Registered User.
Local time
Today, 07:16
Joined
Apr 19, 2002
Messages
69
Hardcoding the path should work fine. I've also experienced that if you just save it with the correct picture, that it will stay that way. I'm guessing that the code you submitted runs on the open event?
 

SteveClarkson

Registered User.
Local time
Today, 07:16
Joined
Feb 1, 2003
Messages
439
It runs OnCurrent

But yeah, same difference.

Would that also work if the user were to delete the picture in the frame? If they use the "Delete Picture" button, would it then revert back to my default image?

Thanks
 

chenn

Registered User.
Local time
Today, 07:16
Joined
Apr 19, 2002
Messages
69
Are you storing the user's picture (or path) in a table? Maybe you could setup your table with the picture path, and user. For the default, make the user = 'default' and the path be the path to the default picture. Each user will have an entry in the table under their user name. On the open event, you could look in the table for the user's picture and set the picture property, if not found use the defuault users path.
 

Users who are viewing this thread

Top Bottom