OLE Auto Attach By Field Name

xcrx

Edge
Local time
Today, 12:19
Joined
Oct 21, 2009
Messages
80
I was wondering if anybody knew of a way to to create an automatic OLE attachment base on a specific field.

What I was thinking was adding an OnUpdate function to the field I want to use and after it is updated it look for a jpg with the same name to link to the OLE field for that record.

Any help would be appreciated.
 
Try this simply jpegs:

Code:
Function GetPicture()
Dim FullPath As String
    With CodeContextObject
        FullPath = GetImageDir & .[Image File]
        If Dir([FullPath]) <> Empty Then
            .[ImageControl].Visible = True
            .[ImageControl].Picture = FullPath
        Else
            .[ImageControl].Visible = False
        End If
    End With
End Function

GetImageDir is the path and directory
[Image File] is the RecordID and ".jpg"

Simon

Simon
 
That sounds similar to something else that I tried, does it work with reports?
 
Indeed put your GetPicture call on the Detail Section On Format.

The ImageControl has to cleared (Visible = False) if there is no image as the same image may still get repeated until a change of image, well that use to happen with Access 1997.

Simon

Simon
 
Okay, I'll give that a try on Monday when I get back to work. I'll let you know how it turns out.
 

Users who are viewing this thread

Back
Top Bottom