Results 1 to 3 of 3
  1. #1
    stepwaec is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    5

    Question Need help to link pictures in a form

    Case:
    Employee Database
    • Table: Betriebspersonal

    • Primary Key: Personalnummer (Number)

    • Pictures of the employees in a folder (PictureFolder/Personalnummer.jpg)

    • Query with the link of the picture as text (Pictures: "PictureFolder\" & [Betriebspersonal]![Personalnummer] & ".jpg")

    • Form that should show the picture and further Information about the employee




    Problem
    How can I link the employee pictures automatically to the form?

    I thought this should actually be quite simple to realise but I couldn't find a specific solution to my problem on google. so I hope some genius can help me.

    Thanks,
    Stephan

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209

    Need help to link pictures in a form

    1. Create an Unbound Image control (select it from the toolbox and draw it on the Form in the required size) on the Employees Form.
    2. Change it's Name Property value to Photo.
    3. Copy and paste the following VBA Code into the Employees Form VBA Module:

    Code:
    Private Sub Form_Current()
    Dim ximg, path
        path = "C:\picturefolder\"
        ximg = Me![employeenumber]
        Me.Photo.Picture = path & ximg & ".jpg"
    End Sub
    Correct the above Code whereever change required to match the foldername, employeenumber etc.

    When you move the employee records on the Form one after the other their pictures will appear on the Photo control automatically. The picture name should match the employee number with .jpg file extension like: 12345.jpg.

    Learn another trick with pictures from this link: Run Slide Show when the Form is idle

  3. #3
    stepwaec is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    5

    Thumbs up

    Thanks for your help. It worked

    I just used the "image" icon instead of the "unbound object frame" as it didn't work with the unbound object frame.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-07-2011, 09:04 AM
  2. Replies: 6
    Last Post: 07-21-2010, 05:25 PM
  3. Link PDF on form
    By Cae in forum Forms
    Replies: 3
    Last Post: 01-09-2010, 07:49 AM
  4. Using Pictures as varibles in a form
    By PPTom in forum Access
    Replies: 1
    Last Post: 08-18-2009, 04:05 AM
  5. Import/Link Pictures into a table
    By shm138 in forum Import/Export Data
    Replies: 3
    Last Post: 03-17-2006, 08:12 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums