Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332


    Quote Originally Posted by ItsMe View Post
    I think the OP is talking about a combo box control. ItemsSelected is not in scope. Also, the For Each ctl in statement should set ctl =
    Afraid you got it mixed up my friend. He is using a Listbox. His ComboBoxes are clearing fine according to his original post.

    Rather than doing a loop through all the selected values, if he just changes the collection to a null or nothing it should clear out the selected values for him. Much easier IMO.

  2. #17
    DB88 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    110
    ItsMe,

    My code above that clears the ComboBox is working fine. I need help adding a ListBox clear

  3. #18
    DB88 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    110
    Xipooo,
    I don't want to clear the ListBox rowsource. Hence me telling you that your suggestion of ctl.RowSource="" does not work and that RowSource is not the way to go.

    I attempted your suggestion of Set ctl.ItemsSelected=Null and get a compile error "Invalid Use of Property". Maybe ItemsSelected is not the appropriate property either. Like I said I'm very new to VBA (like 2 hours), so I'm trying to figure out what ListBox property is responsible for holding a user selection. Once we have that, clearing it should be easy.

  4. #19
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Here, just do this...

    http://allenbrowne.com/func-12.html

  5. #20
    DB88 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    110
    That will work, thanks!

  6. #21
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Xipooo View Post
    Afraid you got it mixed up my friend. He is using a Listbox. His ComboBoxes are clearing fine according to his original post.
    ...
    OK, I was not tracking. Thought the whole thing was around a combo.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 08-25-2012, 07:19 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