Results 1 to 6 of 6
  1. #1
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114

    Multi List Issues.

    Hi, I have done some research on this but find the instructions all over the place. I want to create a multi-list drop down on a form that allows a user to select more then one option. Then I would like that


    data put in the associated table. I have the multi select working however nothing gets put into the table.

    Would rather have a check box but I don't see that option in Access 2010. So for now it just highlights them. Tried microsofts version of this but just get errors and doesn't work.

    Thanks
    PeterClick image for larger version. 

Name:	Capture.JPG 
Views:	13 
Size:	14.0 KB 
ID:	24181

  2. #2
    mrmmickle1's Avatar
    mrmmickle1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    North Carolina
    Posts
    78
    This will give you the values of the multiselect listbox:

    Code:
    Private Sub testmultiselect_Click()
        Dim oItem As Variant
        Dim sTemp As String
        Dim iCount As Integer
        
        iCount = 0
                
        If Me!NamesList.ItemsSelected.Count <> 0 Then
            For Each oItem In Me!NamesList.ItemsSelected
                If iCount = 0 Then
                    sTemp = sTemp & Me!NamesList.ItemData(oItem)
                    iCount = iCount + 1
                Else
                    sTemp = sTemp & "," & Me!NamesList.ItemData(oItem)
                    iCount = iCount + 1
                End If
            Next oItem
        Else
            MsgBox "Nothing was selected from the list", vbInformation
            Exit Sub  'Nothing was selected
        End If
        
        Me!mySelections.Value = sTemp
    End Sub

    I imagine you can just run an update query with sTemp value after you have that....

  3. #3
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Sorry I am really new to code and this is lost on me. How am I using this code? Am I creating a button for it?

    I created a multidrop down in a table however getting this added to a form seems to be an issue. I want the users to not ever have to use anything but the form for entry.
    Gotta be a way to do this without writing code.

  4. #4
    mrmmickle1's Avatar
    mrmmickle1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    North Carolina
    Posts
    78
    pharrison74,

    I agree there is probably another method. I was code heavy in Excel VBA before I ever opened Access so I prefer to write code.

    The Code would be added to a Submit button in your form.

    Along with a few other code lines to run your update query:

    Code:
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "PutYourQueryHere"
    DoCmd.SetWarnings True

  5. #5
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    I was able to figure it out without using code.

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

    Then on your form add the field you created in the above article. Then go to properties of the list and change it to a multivalued list. Took
    a bit of fooling to get it to work..... Hard to explain.

    Pete

  6. #6
    mrmmickle1's Avatar
    mrmmickle1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    North Carolina
    Posts
    78
    Thanks for the follow up. More than one way to skin a cat .

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

Similar Threads

  1. Multi Search Form in Access 2010 Issues
    By AccessJunky in forum Access
    Replies: 4
    Last Post: 08-23-2019, 11:02 PM
  2. Replies: 1
    Last Post: 02-15-2016, 04:48 PM
  3. Replies: 15
    Last Post: 11-20-2013, 04:30 PM
  4. multi select issues
    By ACMC in forum Access
    Replies: 1
    Last Post: 07-26-2013, 03:42 PM
  5. Multi-Field Search issues within Query
    By stiracerdude in forum Queries
    Replies: 3
    Last Post: 10-14-2012, 01:04 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