dbTalk Databases Forums  

ListBox ListIndex <> Selected Value

comp.databases.ms-access comp.databases.ms-access


Discuss ListBox ListIndex <> Selected Value in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob Darlington
 
Posts: n/a

Default ListBox ListIndex <> Selected Value - 01-23-2012 , 10:11 PM






I'm still persevering with my Multi select (extended) list box problems and
have now identified the stumbling point.

I use the KeyPress event to find a record beginning with the pressed key and
the record is located in the list box (using lstBox.Selected(i) = True. The
form is then filtered correctly. At this point the item selected in the list
box and the form show the same record.

In an unbound control in the form, I have a text box called 'LstIndex'
containing '=lstBox.ListIndex'.
The value displayed in this text box doesn't change when the KeyPress event
changes the selection. It changes to the correct value whenever the Click or
KeyDown events occur, but not for the KeyPress.

If I press F9 to recalculate, the LstIndex displays '-1'.

My question is why doesn't the ListIndex reflect the item selected? Surely
these should always be in sync.

--
Bob Darlington
Brisbane

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.