Results 1 to 3 of 3
  1. #1
    rebeccab is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    4

    Use a check box to populate a multi value combo box?

    I have a database that stores information on suppliers. As part of this, I need to collect information relating to the sites that the suppliers will cover - the sites are split into regions.

    Currently, I ask users to select each site from a multivalue combo box on a form (which is split by region) however this can take time if the supplier will cover our whole network or whole region. Is there a way of filling in the combo box from a tick box, i.e. "AllCentralSites" checkbox will autofill the "CentralSitesCovered" combo box with all of the sites?



    This may seem like a strange request as it duplicates info, however I need to report on the suppliers by site and region split down into site.

    Thanks in advance for your help!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Would need code that causes each item to be selected.

    Bing: vba multi-value field combobox select all

    Review http://stackoverflow.com/questions/1...elect-all-none
    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
    rebeccab is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    4
    I have now solved this - I used the following code on the AfterUpdate event of the check box to select all/deselect all of the items in the multi-value CBO.

    Code:
    Private Sub chkbox1_AfterUpdate()
    If Me.chkbox1= True Then
    Dim SelVals(), i
    ReDim SelVals(0 To cboMV1.ListCount - 1)
    For i = 0 To cboMV1.ListCount - 1
         SelVals(i) = CcboMV1.Column(1, i)
    Next i
    cboMV1.Value = SelVals
        End If
    If Me.chkbox1= False Then
    cboMV1.Value = Array()
    End If
    End Sub

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

Similar Threads

  1. Replies: 2
    Last Post: 05-29-2014, 09:58 PM
  2. Replies: 7
    Last Post: 04-01-2014, 02:08 PM
  3. Replies: 7
    Last Post: 12-10-2013, 11:30 PM
  4. Multi Select Check Boxes?
    By CDavis10 in forum Forms
    Replies: 2
    Last Post: 07-19-2013, 07:04 AM
  5. Multi User Logon: Check Box = Diffrent Forms
    By Zantox in forum Programming
    Replies: 7
    Last Post: 11-11-2012, 01:01 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