Results 1 to 2 of 2
  1. #1
    JessiRight is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    9

    Question Pictures stored as link briefly "blink" (reload?) when moving between records...

    Hi, all. I am using Access 2013 on Windows 7 (64-bit).
    I am creating an Inventory database that displays a picture of the item on the form.
    I want to display the picture from a link (as opposed to embedding it) in order to keep my database small.
    I have successfully done this years ago on another database using Access 2007 by following a procedure that someone gave me (I've listed it at the end).
    However, in my new Inventory database, when I move from record to record in the form, it exhibits the following annoying behavior:
    Record 1 displays a picture of a refrigerator... but when I move to Record 2, the picture of the refrigerator briefly reloads(?) again before switching to the correct picture for Record 2 (a Mixer).
    This happens on every record, which means that the pictures appear to be flickering or blinking as I move through the records in the form.
    This is extremely annoying, and it doesn't happen in the other database I created earlier using the same procedures.

    Here is what I did to display the pictures from a link... Does anyone know what I'm doing wrong??? I would greatly appreciate some insight!

    1. Add a Field to Table: Add a new field to the table that will be the underlying table for the form that will display the pictures. This field will hold the path for the picture link.



    Table: tblItems
    ----------------------------
    Field Name: fldImagePath
    Data Type: Text


    2. Enter the Path to Each Picture: Open the table and add the full path and the name of each picture file to each corresponding record.


    3. Add Two Controls to the frmItems Form (That Is Based on the Above Table):

    Image Control:
    ---------------------------------
    Name: ImageFrame
    Insert any picture: "C:\Windows\Circles.jpg" (any picture in the folder will work)

    Text box:
    ---------------------------
    Name: txtImagePath
    ControlSource: fldImagePath


    4. Add Code: On the form’s Design menu, click “View Code,” and then paste or type the following code:

    Code:
    Function setImagePath()
    Dim strImagePath As String
    On Error Goto PictureNotAvailable
    strImagePath = Me.txtImagePath
    Me.ImageFrame.Picture = strImagePath
    Exit Function
    PictureNotAvailable:
    strImagePath = "C:\Windows\.....(insert path)…\NoPicture.jpg"
    Me.ImageFrame.Picture = strImagePath
    End Function
    5. Modify the Form’s Properties:

    In the form’s OnCurrent and AfterUpdate events, type: =setImagePath()

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Are you familiar with the Image control? Access 2007 added ControlSource property to the Image control. It is possible to dynamically display images with the Image control by setting the ControlSource property.

    The ControlSource can be an expression:

    =Nz([fieldname with image path], "C:\Windows\.....(insert path)…\NoPicture.jpg")
    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.

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

Similar Threads

  1. Replies: 13
    Last Post: 09-14-2014, 05:48 PM
  2. Replies: 1
    Last Post: 04-12-2013, 07:56 AM
  3. Replies: 13
    Last Post: 01-30-2013, 03:05 PM
  4. Replies: 6
    Last Post: 01-28-2013, 01:37 PM
  5. Creating "Edit Record" link in table column
    By joshearl in forum Forms
    Replies: 1
    Last Post: 12-25-2009, 11:17 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