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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|