ListBox-rows Not Displaying Selected-state Correctly After Many VBA Requeries
Access 2010 Desktop
this is very weird (and urgent).
when i select rows in a ListBox control on a form, using access VBA, some rows behave exactly the opposite of how they're supposed to behave-- they APPEAR unselected when i select them, and selected when i unselect them.
However, when i check their Selected property with VBA they return the expected value (meaning the row Selected value is TRUE if i set it to TRUE, if tho it LOOKS UNselected).
video:
Access ListBox Control Under VBA Control Behaving Wacko - YouTube
It seems that the more times i requery the listbox, the worse the problem gets.
This problem seems unrelated to the number of times i select rows. Only seems related to multiple requeries. At first, it does not happen. Then with repeated requeries, the problem gets progressively worse.
Note, 'Row Source Type' is set to 'Table/Query'. 'Multiselect' is set to 'Simple'.
i'm not using the "Form_" syntax anyplace (which can created unintended instances of forms).
not sure if relevant, but this listbox source-query contains a VBA function in a module, which in turn calls the code-behind of another form.
help!
posted here:
http://p2p.wrox.com/access-vba/9232...state-correctly-after-many-vba-requeries.html
http://www.access-programmers.co.uk/forums/showthread.php?p=1335219
http://www.techsupportforum.com/for...orrectly-after-many-vba-requeries-804257.html
http://www.utteraccess.com/forum/Grid-rows-Displaying-Sel-t2015549.html
http://www.vbaexpress.com/forum/sho...-Selected-State-Correctly&p=305855#post305855
Access 2010 Desktop
this is very weird (and urgent).
when i select rows in a ListBox control on a form, using access VBA, some rows behave exactly the opposite of how they're supposed to behave-- they APPEAR unselected when i select them, and selected when i unselect them.
Code:
oListBox.Selected(lngRow) = True
However, when i check their Selected property with VBA they return the expected value (meaning the row Selected value is TRUE if i set it to TRUE, if tho it LOOKS UNselected).
Code:
Print oListBox.Selected(lngRow)
->True
video:
Access ListBox Control Under VBA Control Behaving Wacko - YouTube
It seems that the more times i requery the listbox, the worse the problem gets.
Code:
oListBox.Requery
This problem seems unrelated to the number of times i select rows. Only seems related to multiple requeries. At first, it does not happen. Then with repeated requeries, the problem gets progressively worse.
Note, 'Row Source Type' is set to 'Table/Query'. 'Multiselect' is set to 'Simple'.
i'm not using the "Form_" syntax anyplace (which can created unintended instances of forms).
not sure if relevant, but this listbox source-query contains a VBA function in a module, which in turn calls the code-behind of another form.
help!
posted here:
http://p2p.wrox.com/access-vba/9232...state-correctly-after-many-vba-requeries.html
http://www.access-programmers.co.uk/forums/showthread.php?p=1335219
http://www.techsupportforum.com/for...orrectly-after-many-vba-requeries-804257.html
http://www.utteraccess.com/forum/Grid-rows-Displaying-Sel-t2015549.html
http://www.vbaexpress.com/forum/sho...-Selected-State-Correctly&p=305855#post305855
Last edited: