Solved

Picture to Label

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

810 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