![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm using a multi select list box after update event to call a separate function to build a filter for a form using: strList = "" With Me!lstLAN For Each lstItem In .ItemsSelected If IsNull(Me!lstLAN.ItemData(lstItem)) Then Exit For vLAN = Me!lstLAN.ItemData(lstItem) If strList = "" Then strList = "(LAN = "& vLAN Else strList = strList& " OR LAN = "& vLAN End If Next End With If strList<> "" Then strList = strList& ")" strList is then used to filter the form. If the after update is generated by the click event, all works fine. But if the arrow down key is used, the previously selected item is displayed instead of the current selection. I seem to be missing something regarding the ItemsSelected bit. Could anyone help me out? |
#3
| |||
| |||
|
|
As far as I know, you are not selecting an item when you arrow down or arrow up if the multi-select is set to Simple. If you arrow down, the item is not selected (not highlighted). If you then press the space bar then the item is selected. If the multi-select is set to complex, the behavior appears to be different in that the item is highlighted. However, the problem is that the after update event does not occur when you move into the item using the arrow keys. The after update event fires as you move out of the item. So there is a difference in behavior between clicking on an item in the list and moving to the item using the keyboard. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 6/20/2011 1:47 AM, Bob Darlington wrote: I'm using a multi select list box after update event to call a separate function to build a filter for a form using: strList = "" With Me!lstLAN For Each lstItem In .ItemsSelected If IsNull(Me!lstLAN.ItemData(lstItem)) Then Exit For vLAN = Me!lstLAN.ItemData(lstItem) If strList = "" Then strList = "(LAN = "& vLAN Else strList = strList& " OR LAN = "& vLAN End If Next End With If strList<> "" Then strList = strList& ")" strList is then used to filter the form. If the after update is generated by the click event, all works fine. But if the arrow down key is used, the previously selected item is displayed instead of the current selection. I seem to be missing something regarding the ItemsSelected bit. Could anyone help me out? |
![]() |
| Thread Tools | |
| Display Modes | |
| |