Solved

Picture to Label

Posted on 1998-06-22
2
158 Views
Last Modified: 2010-05-03
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
Comment
Question by:paulca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
swilt earned 10 total points
ID: 1463972
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
 

Expert Comment

by:warrencc
ID: 1463973
You could also create a BMP file that says "No photo available" and have it load whenever required.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month6 days, 21 hours left to enroll

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question