Results 1 to 3 of 3
  1. #1
    Mclaren is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164

    Linking to images

    I have decided to remove all images from my front end and place these in a folder.



    All works fine with my forms until i move it from one PC to another. I know this is because the path to the folder changes depending on where it is stored on the new PC. I have a table that stores the path to the folder as a text field. I can change the path in the field to the new location but how do i get the pictures property to point to the new field.

    I know how to do a lookup to get the value using VB, but how do I set the image property in VB ?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    For the image control, try setting ControlSource property to the field with image path and name and the Picture property to (none).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Mclaren is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164
    this worked (but will need a bit more work to use a path that is saved in a table):

    Code:
    Dim vImagePath As String
    vImagePath = GetDBPath & "images\menu.png"
    Me.Image2.Picture = vImagePath
    Relies on :

    Code:
    Public Function GetDBPath() As String
        GetDBPath = CurrentProject.path & "\"
    End Function

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

Similar Threads

  1. Question regarding images
    By FM_5k in forum Forms
    Replies: 5
    Last Post: 05-06-2011, 02:54 PM
  2. Replies: 0
    Last Post: 03-04-2011, 10:28 AM
  3. Linking to Images in Access using VBA
    By Obeng in forum Access
    Replies: 1
    Last Post: 10-30-2010, 05:39 PM
  4. Replies: 17
    Last Post: 08-26-2009, 11:27 AM

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