Solved

Picture to Label

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

910 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

22 Experts available now in Live!

Get 1:1 Help Now