What is the quickest and simplest way to populate a listbox form where the data type is an attachment. There can be multiple 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.
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.
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!