Results 1 to 3 of 3
  1. #1
    erikforeman is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    3

    displaying attachments from a different control source in a form

    I have images I store as attachments in an access 2007 table named "Assets". The field that holds the attachments is called "Attachments". I have a form that is accessing a different table called Services. I have placed a button in this form for the purpose of brining up images that have been stored in the assets table that relate to the item being serviced. I would rather not have those images load unless specifically requested to do so.(maybe that is wrong of me, not sure) I tried:
    "[BarCode] = [txtBarCode].Value")


    Code:
        imgAttachments.ControlSource = "Assets.Attachments"
        imgAttachments.DefaultPicture = DLookup("[Attachments]", "Assets", "[BarCode] = [txtBarCode].Value")
    I also tried it without the first line
    Code:
     imgAttachments.ControlSource = "Assets.Attachments"
    either way I get an error saying it can not open the imagename.jpg file error 2220.

    any suggestions would be appreciated.

  2. #2
    erikforeman is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    3
    I just tried using
    Code:
    imgAttachments.OnAttachmentCurrent = DLookup("[Attachments]", "Assets", "[BarCode] = [txtBarCode].Value")
    and at least I did not get any errors, however there was no image displayed in the image box.

  3. #3
    erikforeman is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    3
    Code:
    imgAttachments.OnAttachmentCurrent = DLookup("[Attachments]", "Assets", "[BarCode] = [txtBarCode].Value")

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

Similar Threads

  1. Replies: 2
    Last Post: 04-15-2011, 01:13 PM
  2. control source
    By nashr1928 in forum Forms
    Replies: 5
    Last Post: 03-12-2011, 09:31 PM
  3. Form not displaying source table data
    By Sarge, USMC in forum Forms
    Replies: 6
    Last Post: 10-25-2010, 07:36 AM
  4. linked table displaying different data than source
    By wil in forum Import/Export Data
    Replies: 1
    Last Post: 08-06-2010, 07:13 AM
  5. one form two sources - invalid control source msg
    By techexpressinc in forum Forms
    Replies: 1
    Last Post: 05-28-2010, 02:11 PM

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