dbTalk Databases Forums  

Multiselect List Box

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


Discuss Multiselect List Box in the comp.databases.ms-access forum.



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

Default Multiselect List Box - 08-09-2011 , 02:19 AM






I'm using a multiselect list box in Access 2010 and trying to set the
'Selected' value for a list row using:
With me!lstCont
.SetFocus
mCurrentIndex = .ListIndex
.Selected(mCurrentIndex + vIntegerValue) = True
End With
But the result is the original item still being selected.
Using .ListIndex = mCurrentIndex + vIntegerValue gives the same result

On a second form, the above seems to work, but I can't work out how to
ensure that a selected row (using VBA) is visible when the ListCount is
greater than the number of rows displayed.

Any help would be appreciated.

--
Bob Darlington
Brisbane

Reply With Quote
  #2  
Old   
Douglas J. Steele
 
Posts: n/a

Default Re: Multiselect List Box - 08-09-2011 , 05:33 PM






Check what Stephen Lebans has at http://www.lebans.com/List_Combo.htm



Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
Co-author: "Access Solutions", published by Wiley
(no e-mails, please!)


"Bob Darlington" wrote in message
news:4e40df98$0$2442$afc38c87 (AT) news (DOT) optusnet.com.au...

I'm using a multiselect list box in Access 2010 and trying to set the
'Selected' value for a list row using:
With me!lstCont
.SetFocus
mCurrentIndex = .ListIndex
.Selected(mCurrentIndex + vIntegerValue) = True
End With
But the result is the original item still being selected.
Using .ListIndex = mCurrentIndex + vIntegerValue gives the same result

On a second form, the above seems to work, but I can't work out how to
ensure that a selected row (using VBA) is visible when the ListCount is
greater than the number of rows displayed.

Any help would be appreciated.

--
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.