Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Employee Information and Pictures

Status
Not open for further replies.

Bennie47250

Programmer
Nov 8, 2001
515
US
Using Access version 97 Could also do this in 2000 or 2002

The Tech Tips search feature is currently unavailable so I have been unable to search the archives for this.

I have a table with Employee information that also includes the path to a picture of the employee that is in JPG format. We would like to develop a list (report) of employees and show the employees picture. How can this be done?

Thanks
Bennie
 
I'm using Access 2000 but I think this pertains to Access 97 as well. If your query contains the employees name and then the path to their picture, in the reports detail section, drag an Image control from the toolbox. Then set the properties for the image control like this:

Set the Picture property of the image control to whatever image you want used if an employee's picture is missing. This will be the default image.

In the same detail section, create a hidden textbox and that equal to the path of the employee's picture [EmployeeImage] from the query.

Then go to the VB Editor and add a function for that detail section:

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)

'Set the image file name
Dim ImageName As String

On Error Resume Next

'Set the file name
ImageName$ = CurrentProject.Path
ImageName$ = ImageName$ & "\"


If IsNull(Me.EmployeeImage) Or Me.EmployeeImage = "" Then
ImageName$ = ImageName$ & "images\none.jpg"
Else
ImageName$ = ImageName$ & Me.EmployeeImage
End If

'Set the image
Me.Image1.Properties(3) = ImageName$



End Sub
 
JDavey,

Thanks for the information but I'm not having much luck getting it to work. Could you e-mail me a condinsed copy of your DB so I could see it first hand? I can be e-mailed to bennie47250@yahoo.com

Plese zip up the file too

Thanks!
 
I got it. Refer to MisrosoftKnowledge Base Article 148463
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top