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:
5. Modify the Form’s Properties: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
In the form’s OnCurrent and AfterUpdate events, type: =setImagePath()