A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Marking items as selected in a Muli-Select listbox



 
 
Thread Tools Display Modes
  #1  
Old October 22nd, 2009, 10:08 PM posted to microsoft.public.access.forms
Mark A. Sam[_3_]
external usenet poster
 
Posts: 468
Default Marking items as selected in a Muli-Select listbox

Hello,

I have a Multi-Select listbox in which I want to mark items selected
according to a field value.

If lstSelectClient.Column(4) 0

Then I want the item highlighted as selected, else not selected.

Background: [lstSelectClient] is a client list which connects employees to
clients. An employee listbox is beside it on the form. [lstSelectClient]
can be filtered by the selected employee or all client records will display
depending on a toggle button. If the user clicks on the [lstSelectClient]
list it toggles the value of Column(4) from 0 to the empolyee number. When
all of the client records are showing is when I when I want the records
highlighted. I hope that makes sense.


Thanks for any help and God Bless,

Mark A. Sam



  #2  
Old October 22nd, 2009, 10:35 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Marking items as selected in a Muli-Select listbox

Untested, but try:

For lngLoop = 0 To (Me!MyListbox.ListCount - 1)
Me!MyListbox.Selected(lngLoop) = (Me!MyListbox.Column(4, lngLoop) 0)
Next lngLoop

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Mark A. Sam" wrote in message
...
Hello,

I have a Multi-Select listbox in which I want to mark items selected
according to a field value.

If lstSelectClient.Column(4) 0

Then I want the item highlighted as selected, else not selected.

Background: [lstSelectClient] is a client list which connects employees
to clients. An employee listbox is beside it on the form.
[lstSelectClient] can be filtered by the selected employee or all client
records will display depending on a toggle button. If the user clicks on
the [lstSelectClient] list it toggles the value of Column(4) from 0 to the
empolyee number. When all of the client records are showing is when I
when I want the records highlighted. I hope that makes sense.


Thanks for any help and God Bless,

Mark A. Sam





  #3  
Old October 22nd, 2009, 11:13 PM posted to microsoft.public.access.forms
Mark A. Sam[_3_]
external usenet poster
 
Posts: 468
Default Marking items as selected in a Muli-Select listbox

Thanks Doug,

I had pretty much the same method as you gave me. I was trying to implement
it from the AfterUpdate event of the listbox. When I moved it to the click
event it worked. Your method was less lines than mine so I used it.

God Bless,

Mark


"Douglas J. Steele" wrote in message
...
Untested, but try:

For lngLoop = 0 To (Me!MyListbox.ListCount - 1)
Me!MyListbox.Selected(lngLoop) = (Me!MyListbox.Column(4, lngLoop)
0)
Next lngLoop

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Mark A. Sam" wrote in message
...
Hello,

I have a Multi-Select listbox in which I want to mark items selected
according to a field value.

If lstSelectClient.Column(4) 0

Then I want the item highlighted as selected, else not selected.

Background: [lstSelectClient] is a client list which connects employees
to clients. An employee listbox is beside it on the form.
[lstSelectClient] can be filtered by the selected employee or all client
records will display depending on a toggle button. If the user clicks on
the [lstSelectClient] list it toggles the value of Column(4) from 0 to
the empolyee number. When all of the client records are showing is when
I when I want the records highlighted. I hope that makes sense.


Thanks for any help and God Bless,

Mark A. Sam







  #4  
Old October 27th, 2009, 10:07 AM posted to microsoft.public.access.forms
Cecilia Abreu Teixeira
external usenet poster
 
Posts: 1
Default Marking items as selected in a Muli-Select listbox

sorry


On 09/10/22 21:08, in article , "Mark
A. Sam" wrote:

Hello,

I have a Multi-Select listbox in which I want to mark items selected
according to a field value.

If lstSelectClient.Column(4) 0

Then I want the item highlighted as selected, else not selected.

Background: [lstSelectClient] is a client list which connects employees to
clients. An employee listbox is beside it on the form. [lstSelectClient]
can be filtered by the selected employee or all client records will display
depending on a toggle button. If the user clicks on the [lstSelectClient]
list it toggles the value of Column(4) from 0 to the empolyee number. When
all of the client records are showing is when I when I want the records
highlighted. I hope that makes sense.


Thanks for any help and God Bless,

Mark A. Sam




 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.