Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

Picture to Label

I have a photo appearing if the file is present in the app.path directory.  The name of the photo file corresponds with a student ID number in the Access database and is bmp file format.  Some photos that correspond to the student ID's are not present and for these non-present photos I want a label to appear reading No Photo Available.  How do I code for this?
0
paulca
Asked:
paulca
1 Solution
 
swiltCommented:
I hope this is what you want


sFilePath = App.Path & "\" & sStudentID
If dir$(sFilePath) = "" then
    Label1.Visible = True
    Picture1.Visible = False
Else
    Label1.Visible = False
    Picture1.Visible = True
    Picture1.Picture = LoadPicture(sFilePath)
End If
0
 
warrenccCommented:
You could also create a BMP file that says "No photo available" and have it load whenever required.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now