Results 1 to 3 of 3
  1. #1
    Dave_D's Avatar
    Dave_D is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    67

    Populate a form listbox where data type fields are attachments


    What is the quickest and simplest way to populate a listbox form where the data type is an attachment. There can be multiple attachments.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    SELECT ID, AttachmentFieldName.FileName FROM TableName;

    An attachment field is a multi-value type. Review:

    https://support.office.com/en-us/art...3-B6624E1E323A

    https://support.office.com/en-us/art...C-6DE9BEBBEC31
    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
    Dave_D's Avatar
    Dave_D is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    67
    Your 2 links helped andprovided me my solution. I made my listbox bound (orange) and used thecontrols from the query to populate the listbox. It worked preciselyadding each attachment as I had hoped for. But as I continued to develop thisprocess, my goal is to use this listbox for multiple purposes. First off,I need to value the listbox from the query. Now after it's populated, I wouldlike to use the controls just right of the listbox. I found I could notdo this because of the listbox was bound. So, I'm trying again to find asolution to populate this listbox from the query where thefield from the query are attachments. Here's the code that I'm strugglingwith:

    Private Sub Load()
    Dim rs as DAO.Recordset

    Set rs = CurrentDb.OpenRecordSet("qry_QResponse", dbOpenDynaset)

    Me.LstAttachment.RowSource= "qry_QResponse")
    Me.LstAttachment.RowSourceType= "Value List"


    'Here's where I'm struggling not knowing which syntax is correct,but I'vetried:


    Me.LstAttachment.AdditemSource= "qry_QResponse"

    which only returned the literal qry_QResponse twice.

    The field on the query is named ShareDoc, which is an attachment having 2attachments.

    Any help will be appreciated!
    Thank you!

    Click image for larger version. 

Name:	form.jpg 
Views:	3 
Size:	249.2 KB 
ID:	35045

    Attached Thumbnails Attached Thumbnails form.png  

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

Similar Threads

  1. Replies: 7
    Last Post: 10-13-2016, 12:32 PM
  2. Replies: 8
    Last Post: 03-18-2016, 07:13 AM
  3. Replies: 13
    Last Post: 09-10-2015, 03:37 PM
  4. Replies: 8
    Last Post: 03-24-2015, 09:56 AM
  5. Replies: 4
    Last Post: 09-04-2012, 09:17 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