Results 1 to 4 of 4
  1. #1
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407

    multiple selection in sub form

    Hi All,
    I am currently using the code below to populate email attachment list from a list box on my form.
    i would like to know if it can also be done with a subform control. EG
    select multiple rows in subform and use that to create the attachment list?



    Code:
        'get attachments
        With myItem
            For Each vItem In lst.ItemsSelected
                If Not IsNull(vItem) Then
                   myItem.Attachments.Add = lst.ItemData(vItem)
                End If
            Next
            Set lst = Nothing
        End With

  2. #2
    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
    Not sure I really understand your question. Are you saying you want only certain attachments for certain emails?
    Whatever you have in your listbox (the row source),you could put in a subform. But I'm not sure what would be the difference.
    If the user can identify the things to be attached from the listbox, that seems straightforward.

    Now if it's an academic exercise to show it is possible, that's a different story. I could see showing each record and having a check box or clicking on the record in the subform and having code to add that record to the attachments.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Looping through records selected by highlighting is possible but the selection must be for sequential records.

    Whereas a multi-select listbox allows non-sequential selection. As would a bound checkbox in a form.
    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.

  4. #4
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    thanks, I'll have to stick with the list box then.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-18-2013, 04:08 PM
  2. Multiple choice selection
    By Moridan in forum Access
    Replies: 35
    Last Post: 04-26-2013, 01:38 PM
  3. Multiple Selection wth List Box / Combo Box
    By rkalapura in forum Forms
    Replies: 11
    Last Post: 02-09-2013, 11:02 PM
  4. Replies: 21
    Last Post: 10-05-2012, 11:36 AM
  5. Multiple record selection on list box?
    By looloo in forum Forms
    Replies: 2
    Last Post: 09-22-2011, 05:52 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