• Getting an Image into an OLE Field (XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Getting an Image into an OLE Field (XP)

    Author
    Topic
    #456142

    I have an application that uses just two images and the client wants to store them in OLE fields. I Have a field for the path to the Image as well.
    I allow the user to get the path to the image using a file dialog.

    How do I get that image into the OLE field using VBA code. Say in the after update event of the path field.

    It is just a bit cumbersome to have the user use the insert from the menu.

    Viewing 0 reply threads
    Author
    Replies
    • #1138510

      You can use code like this, assuming that a picture has already been loaded at least once before:

      With Me.oleCtl
      .SourceDoc = Me.txtPath
      .Action = acOLECreateEmbed
      End With

      where oleCtl is the name of the OLE control and txtPath is the name of the text box containing the path and filename.

    Viewing 0 reply threads
    Reply To: Getting an Image into an OLE Field (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: