Grab selected item in listbox

Trogdor

Registered User.
Local time
Tomorrow, 04:17
Joined
Oct 22, 2008
Messages
32
Hey all,

I am on a new project, and I am trying to use listboxes for a queueing system.

What I have done is I have created a unique ID and when someone enters the queue that unique plus the string Person is added to a list box.

e.g. Person-1

What I need to do now is when another event occurs it needs to look in the queue to see which person is selected and then that ID is put into a table.

The trouble I am having is grabbing the string of the selected item in the list. I am using the following code to grab the ID but at the moment I am using a static string for the person, rather then the one from the list box.

Code:
' Get Persons_ID and add to captured Data
    
    Dim failed As Integer
    Dim countdashes As Integer
    Dim failedID As String
    
    failedID = "Person-12"
    
    countdashes = InStrRev(failedID, "-")
    failed = right(failedID, (Len(failedID) - countdashes))

Thanks for the help!
 
okay.. sorry.. I think i just got it.. It's been a logn day :P

I changed failedID = "Person-12" to

failedID = me.lstFailed.value

It seems to work now :)
 

Users who are viewing this thread

Back
Top Bottom