Results 1 to 4 of 4
  1. #1
    gretarocio is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2021
    Posts
    4

    Clear Button in combo box and list box

    HI


    I am new in access I would like to know how to clear an cascading combo boxes (cmb...) and list box that select multiples items (lstData)
    I used the code but Ii only works for the combo boxes. Could you please someone help. Thanks

    Private Sub btnClean_Click()
    Me.cmbINSWProjectData = " "
    Me.cmbDatasetData = " "
    Me.lstData = " "


    Me.cmbINSWProjectData.SetFocus


    End Sub

  2. #2
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,958
    you shouldn't need to include a space - and if your combos are bound to a numeric field you will get an error

    if your listbox is a multi select listbox, you need to clear all the selections

    see this link for a couple of ways to do this

    https://stackoverflow.com/questions/21055720/clear-items-selected-from-listbox

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,771
    What does clear a listbox mean, deselect all selected items or remove the list entirely?
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,771
    Please don't post the same question in multiple forums.

    https://www.accessforums.net/showthread.php?t=82972
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

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

Similar Threads

  1. Replies: 6
    Last Post: 02-15-2015, 11:51 AM
  2. clear checkbox and list box using TypeOf......Is
    By Chuck55 in forum Programming
    Replies: 13
    Last Post: 04-06-2012, 08:21 PM
  3. How do I clear the list of recent dbs?
    By revnice in forum Access
    Replies: 4
    Last Post: 01-25-2012, 11:24 AM
  4. Clear value list in combo box
    By jgelpi16 in forum Programming
    Replies: 4
    Last Post: 05-27-2011, 12:45 PM
  5. Clear selections from a List Box?
    By Dreams2Fly in forum Forms
    Replies: 3
    Last Post: 03-28-2011, 02:25 PM

Tags for this Thread

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 - Senior Forums