INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Access Howto:

How to Load a picture in Access form by DougP
Posted: 14 Nov 00

What this does...
It loads a picture ie .jpg or .gif or .bmp into an Image control on the form.  So as you navigate through the records it automatically loads a picture from the hard drive.
Note: It might be slow if the picture is large or you have a slow machine. A Pentium II or better should be fine.
Benefits: Can have thousands/10's of thousands of pictures and does not Bloat database. Becasue no pictures are inside the database they are left on the hard drive.

Steps:
1. Add an "Image" control to the form.
   Follow the prompts and load a picture of the type you will be using.
2. Open the properties of the image and remove the picture.
3. Put this code in the forms On_current event
---------------------------------------
Private Sub Form_Current()
    If Me![ID] <> 0 Then
        Me!Image14.Picture = "p:\ViewPhotos\Photos\" & Me![ID] & ".jpg"
        Label20.Caption = "File: " & " p:\ViewPhotos\Photos\" & Me![ID] & ".jpg"
    End If
End Sub
----------------------------------
The Label20 simply shows the path of the picture for troubleshooting purposes.

Now in my example the picture name was the same as the ID on the form.  So when ID 23454 was showing on the form, it loaded 23454.jpg into the image.

Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close