Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243

    Link, not embed, images in a form

    1. Got path to stored image files set up in table.


    2. Inserted image control onto associated form.
    3. Using properties sheet, I named image control RschrImages;
    4. This is where I'm having trouble: I want the image to appear when the form loads. It's my understanding that I need to choose "On Control" from the options listed in the properties sheet under the Event tab. I'm using Access 2010 and cannot find On Control anywhere throughout the properties sheet.

    I have a few images I set up to display in the form, but those are embedded. As the database grows, I need to be able to link instead of embed images.

    Thank you.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Use the Image control ControlSource property. Set it to the path string of the external image. This can be done by binding to field or by expression in the ControlSource. Is the complete drive\path\filename stored in the text field? Will this db be used from several computer stations?
    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.

  3. #3
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243
    Yes, the drive\path\filename is stored in the text field. At most, the db will be used from 2 computer stations.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Options for path:

    1. if using drive letter path, all users must set a drive path same as saved in the record

    2. use UNC path - Universal Naming Convention - this path uses reference to server name, syntax:
    \\servername\path\filename

    You can exclude the drive and server name from the data in record then construct the path by expression in ControlSource property:

    = "\\servername\" & [fieldname]
    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.

  5. #5
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243
    Thank you for your assistance. However, clearly I'm not getting it. I've included a screen shot. In the screen shot I've deleted part of the path information for privacy. The image links are in another table separate from the form.
    Link images via control source property.

    Linking table

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Neither of those links will open for me.

    Image control must be bound to a field that is included in the form's RecordSource or an expression in the ControlSource to construct the path. I suppose could do a DLookup, never tried, but that is an expression:

    =DLookup("image path field", "tablename", "ID=" [ID])
    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.

  7. #7
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Yes, but not sure it will help.

    It shows an Image control next to a subform. Presume the main form has a RecordSource that includes text field with the image name.

    All expressions in ControlSource must be preceded with = sign.

    =[quantity] * [price]

    literal strings must be within quote marks

    = "Extended price is: " & [quantity] * [price]

    I seldom use the expression builder. I just type what is needed in the ControlSource property. I have provided examples of how to reference images in Image control. If you are trying to type the folder path in expression builder then it needs to be within quote marks because that is a literal string. And don't forget the = sign.

    Don't know how to further clarify.
    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.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847

  10. #10
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243
    Quote Originally Posted by June7 View Post
    Yes, but not sure it will help.

    It shows an Image control next to a subform. Presume the main form has a RecordSource that includes text field with the image name.

    All expressions in ControlSource must be preceded with = sign.

    =[quantity] * [price]

    literal strings must be within quote marks

    = "Extended price is: " & [quantity] * [price]

    I seldom use the expression builder. I just type what is needed in the ControlSource property. I have provided examples of how to reference images in Image control. If you are trying to type the folder path in expression builder then it needs to be within quote marks because that is a literal string. And don't forget the = sign.

    Don't know how to further clarify.
    Thank you for trying to help me. Sorry -- this doesn't seem to be something I can understand via a forum. I need a hands on, in-classroom assistance to understand this.

    Having said that, I have one other question to pose [notify me if it's better to start a new thread]. Casting aside the image issue, this database deals with a lot of attachments for archival purposes. So far, we have 222 records and each record has a minimum of 3 attachments: application, final report, close out letter. Each attachment is a pdf stored in an attachment table that is linked to the student table.

    My question is -- is this going to turn into the same kind of problem that having too many images will? If so, given the fact that linking is far more problematic than embedding, is there a better way of managing the attachments?

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Don't really understand your last questions. Unless the images are very small, embedding images can chew up Access file size limit of 2gb. If the database is small than this is not an issue. 222 records is very, very small. In my view, external image files is not more problematic than embedding.

    Try this test -
    Create a text field in a table and store the path to an external file, maybe saved at the C: root level, like: C:\filename.pdf. Do this for several records and several image file types - jpg, pdf, bmp. Now in an Image control on form (form is bound to the table) bind ControlSource to that field, simply: [fieldname]. Open form in Form View. Can you see images?

    Review this thread https://www.accessforums.net/access/...ent-33853.html and you can download their db to see how they handle images in attachment field.
    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.

  12. #12
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243
    Trying it again. Can you look at this and see what I'm doing wrong. The linked picture does not display.

    Linking table: https://skydrive.live.com/redir?resi...Cdps0xelLy8bqQ
    Code builder: https://skydrive.live.com/redir?resi...NV8DJxOckIKUjE
    Form: https://skydrive.live.com/redir?resi...BS8Yeg-HcWydGU

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    I can see that you aren't doing anything I suggested regarding displaying images.

    The code
    EmployeeImage.Picture - EmployeePicture
    makes no sense to me. What is EmployeePicture - a field on the form?

    Did you do the test I suggested?
    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.

  14. #14
    snowboarder234's Avatar
    snowboarder234 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    243
    Yes, I did the text. Results = no photo. It should be simple, but not working for me. I don't really understand how to use the control source

    1. Put the field name into the Control Source property box: https://skydrive.live.com/redir?resi...O0pvpabV1pK8ns
    2. Image table for linking: https://skydrive.live.com/redir?resi...FwmrZG8tD3oFaY

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Don't need the = sign when binding directly to field but probably doesn't hurt.

    You don't show the entire path of the image file. Is it prefixed with drive letter? Do you have a Windows Explorer mapping to the drive letter? Or is the path using UNC?

    The image name does not have a suffix (.png, .jpg, .bmp). The FULL name needs to be stored, this includes the suffix.
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Unable to embed images on a form.
    By Morogth in forum Forms
    Replies: 3
    Last Post: 11-14-2012, 11:02 PM
  2. Replies: 8
    Last Post: 11-10-2012, 03:03 AM
  3. Cannot Embed bmp images with Access 2010
    By DelbyJones in forum Access
    Replies: 7
    Last Post: 07-31-2012, 08:26 AM
  4. Replies: 1
    Last Post: 08-13-2011, 04:17 PM
  5. link to 100's images based on field name
    By MyWebdots in forum Import/Export Data
    Replies: 1
    Last Post: 11-08-2010, 02:45 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