Results 1 to 3 of 3
  1. #1
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614

    List box : removed items highlighted even after item is removed

    I have a list box and a sub form having Table as their record source. The user can select items in the list box and click of a button adds the selected items to the sub-form and it works perfectly. If the selected item is at the bottom of the list box then that row of the list box is still highlighted, though that item has been removed from the list box. I requery the list box after removing the selected items but the blue coloured strip at that row still shows. The problem is only the appearance of the list box after removal of item. I got around the problem by resetting the row source of listbox in code.
    Code:
     strSQL2 = Me.lstItems.RowSource
        Me.lstItems.RowSource = ""
        Me.lstItems.RowSource = strSQL2
        Me.lstItems.Requery
    Is there any other way ?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Thats the CONTENTS of the list box. The listbox item chosen itself must be set to NULL. lstItems = null
    if multiselect, you may have to scan the list and set to false.

  3. #3
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    if multiselect, you may have to scan the list and set to false.
    Have tried it too, loop through the list box items and set Selected =False but the loop does not accounts for null items.

    Tried lstItems = null but not producing desired result.
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	6 
Size:	79.8 KB 
ID:	18453

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

Similar Threads

  1. Removed duplicates before an export
    By snipe in forum Queries
    Replies: 2
    Last Post: 07-10-2014, 02:59 PM
  2. Features removed from 2013?!
    By jmhultin in forum Access
    Replies: 2
    Last Post: 03-11-2013, 11:13 AM
  3. Removed Enter Paramater Value
    By lsingh165 in forum Access
    Replies: 2
    Last Post: 01-28-2013, 12:52 AM
  4. Replies: 2
    Last Post: 12-21-2010, 12:03 AM
  5. Items being removed from a Combo Box
    By viper in forum Forms
    Replies: 2
    Last Post: 10-14-2010, 08:30 AM

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