Results 1 to 3 of 3
  1. #1
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291

    syntax on setting image Picture control

    I have an image on my report which I want to set to a file path which is saved in a field in the source table. The field with the stored file path is called Picture1. The Image is called imgPicture1



    I tried;
    Me!imgPicture1.Picture = Me.Picture1
    Me!imgPicture1.Picture = Me!Picture1
    Me!imgPicture1.Picture = Picture1
    (and several other variations)

    None of these worked but I made a text box and set the source value to Picture1 and then used

    Me!imgPicture1.Picture = Me.txtTest.Text

    and it worked haha, now is there anyway to do this without having to create a text box to get the data from the record and then set the text box to not be visible?

    llkhoutx sugguested Forms!YourFormName!YourFormOleObjectControlName
    which ended up Forms!DropInletForm!imgPicture1 but that also didnt work.
    Thanks for help.

  2. #2
    Jamy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2010
    Posts
    36
    To make llkhoutx's suggestion work you'll need the form to be open.

    The best way is to have the text box with the text or hyperlink on the report (and hide it). On format event (in detail) is where the code needs to be. I even think the report needs to be in print preview to format.

    However the code u used was OK, unless the picture1 is a hyperlink, then use the hyperlinkpart("name",2) to retrieve the correct text. SO:
    Me!imgPicture1.Picture = Hyperlinkpart(Me.Picture1, 2)

    Let me know if this works.

  3. #3
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    The best I can come up with is making 8 text boxes and setting their control source to the field with the stored path and then setting the picture = to the control box. This is what I had before I did the post but I guess it will have to do, thanks for the response though.

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

Similar Threads

  1. Replies: 10
    Last Post: 11-06-2012, 10:34 AM
  2. if or syntax help needed
    By techexpressinc in forum Queries
    Replies: 16
    Last Post: 01-11-2010, 08:03 AM
  3. Looping syntax
    By fadiaccess in forum Access
    Replies: 1
    Last Post: 10-23-2009, 02:57 AM
  4. Image control in MS Access
    By celestialcitizen in forum Forms
    Replies: 6
    Last Post: 07-03-2009, 03:25 PM
  5. Sending control to specific control
    By wasim_sono in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 08:19 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