Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    15

    Question Unanswered: Can I deselect item in Listbox???

    Setup:
    I have 2 lists on my form. Each is a list of reference numbers. List one has reference numbers which are "late". List two has reference numbers that are "on time". When the user clicks on a reference number in either list, the data for that reference number is displayed on the form. This all works fine.

    Problem:
    Lets say List1 has reference #1, #2, #3 and List2 has reference #4, #5, #6. When I open the form, nothing is selected from either list (ListX.ListIndex=-1 for both lists) and no info is displayed on the form (using DAO, not bound textboxes). Now I click on #1 in List1 and "#1" is highlighted in the listbox. Then I click on #4 in List2 to display it's info.

    Problem --> Now "#1" is highlighted in List1 and "#4" is highlighted in List2. I want to unhighlight "#1" (my last selection from List1) when I click on a reference number in List2 (and vice-versa) so that only one reference is highlighted at once. However, the ListIndex property is read-only so I cannot use "List1.ListIndex=-1". Any ideas???

    Thanks,
    Michael

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    private sub List2_click()
    list1 = null
    end sub

    and vice-versa

    ??? izy
    currently using SS 2008R2

  3. #3
    Join Date
    Mar 2004
    Posts
    15
    Actually List1=[anything other than a reference # in the list] does the trick. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •