Displying employee pictures on form

P

Phil

Hi I have posted this several times and got some good suggestions, however
whenever I try them Microsft access is looking for a macro. I update the
issue but they are not seen so I open another one as I am doing now.
Any suggestion would be appreciated
Thanks


Question posed:
I have a database with over 1000 records and am trying to create a unbound
Object frame to link each record with with the staff photos(not in the database - they are located on a CD). Eact record in the databse has a unique number, each
picture has the same unique number with the externsion .tiff.

What I need is(if possible)

1: How to create the unbound object for the table
2: How to code it so that I do not have to amend each record individually as
this would take quite a long time.
3: How to set this up on a form so that each records phots is
linked/displayed automatically as I traverse through them.
4: If I need to make any amendments how easy would this be

I dont have much experience in programming so the exact steps would be needed


Relp from Dorian which seems easy

I have done this by interting an image control (from the toolbar).
If you look at its properties, you will see the 'Picture' property is the
path to the image.
All you need do in the 'on current' event of your form is to load that
property with the path to your image (e.g. Me!MyImage.Picture =
"C:\Myimage.jpg"). As you move from record to record the image will change.
 
O

Ofer Cohen

When you are trying to use the 'on current' event of the form, first put the
cursor on that event, you can see on the right a button with three dots,
press it.
You'll get the three options, select code view, and there you should enter
the code.
If you write the line of code directly in the line, it will look for a macro

Check this link

http://www.databasedev.co.uk/bound_image_form.html
 
P

Phil

Hi Thanks very much for your update. I can now view the pictures with each
record.
Your help has been much appreciated.

I dont have much experience with coding in VB and want to build in some
error checking if the pictures dont exist - do you have any tips for me??

Thanks again
 
O

Ofer Cohen

This code can check if the picture exist

If Dir(strPath) = "" Then
MsgBox "Picture doesn't exist"
Else
Me![ImageFrame].Picture = Me![ImagePath]
End If
====================
But in the sample that you had in the link I provided you with, the first
line "On Error Resume Next" will make the code contiue running without a
message box if the picture doesn't exist

Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me![ImageFrame].Picture = Me![ImagePath]
End Sub
 
P

Phil

Thanks, you have been very helpful
--
Phil


Ofer Cohen said:
This code can check if the picture exist

If Dir(strPath) = "" Then
MsgBox "Picture doesn't exist"
Else
Me![ImageFrame].Picture = Me![ImagePath]
End If
====================
But in the sample that you had in the link I provided you with, the first
line "On Error Resume Next" will make the code contiue running without a
message box if the picture doesn't exist

Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me![ImageFrame].Picture = Me![ImagePath]
End Sub


--
Good Luck
BS"D


Phil said:
Hi Thanks very much for your update. I can now view the pictures with each
record.
Your help has been much appreciated.

I dont have much experience with coding in VB and want to build in some
error checking if the pictures dont exist - do you have any tips for me??

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top