Results 1 to 2 of 2
  1. #1
    Vaibhav2015 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    14

    how to use multiple check box to select items from multiple combobox

    Hi,
    I have created form and I have two combo box(plant & Sales_org) in that form . I want to select all option from two combobox when I select check box.
    I create below vba codes but , when I just add one combo box in fields its work but when I add fields from both combo box its not working.
    please advice how i can select all fields from both combobox by clicking check box.

    Private Sub Check28_Click()

    If Me!Check28 = True Then
    Me!Plant.Selected(0) = True
    Me!Plant.Selected(1) = True
    Me!Plant.Selected(2) = True
    Me!Plant.Selected(3) = True
    Me!Plant.Selected(4) = True
    Me!Plant.Selected(5) = True
    Me!Plant.Selected(6) = True
    Me!Plant.Selected(7) = True
    Me!Plant.Selected(8) = True
    Me!Plant.Selected(9) = True
    Me!Sales_org.Selected(1) = True
    Me!Sales_org.Selected(2) = True
    Me!Sales_org.Selected(3) = True
    Me!Sales_org.Selected(4) = True
    Me!Sales_org.Selected(5) = True
    Me!Sales_org.Selected(6) = True
    Me!Sales_org.Selected(7) = True

    Else
    Me!Plant.Selected(0) = False
    Me!Plant.Selected(1) = False
    Me!Plant.Selected(2) = False
    Me!Plant.Selected(3) = False
    Me!Plant.Selected(4) = False
    Me!Plant.Selected(5) = False
    Me!Plant.Selected(6) = False
    Me!Plant.Selected(7) = False
    Me!Plant.Selected(8) = False
    Me!Plant.Selected(9) = False
    Me!Sales_org.Selected(1) = False
    Me!Sales_org.Selected(2) = False
    Me!Sales_org.Selected(3) = False
    Me!Sales_org.Selected(4) = False


    Me!Sales_org.Selected(5) = False
    Me!Sales_org.Selected(6) = False
    Me!Sales_org.Selected(7) = False

    End If


    End Sub

  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
    52,929
    What do you mean by 'select all fields' - do you mean 'select all records'? What do you mean by 'not working' - error message, wrong results, nothing happens?

    What is purpose of these comboboxes - data entry into a multi-value field? I NEVER use multi-value fields.
    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.

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

Similar Threads

  1. Replies: 8
    Last Post: 03-28-2014, 12:04 AM
  2. Replies: 10
    Last Post: 07-23-2013, 05:07 PM
  3. Replies: 7
    Last Post: 06-20-2013, 12:09 PM
  4. Replies: 2
    Last Post: 04-10-2013, 03:54 PM
  5. Select multiple items from list box
    By sharmaprashant22 in forum Queries
    Replies: 2
    Last Post: 05-05-2011, 12:18 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