Solved

Picture to Label

Posted on 1998-06-22
2
153 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
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now