can't retrieve value of Listbox control

C

Carol G

I am trying to retrieve the text value from a listbox set to no multiselect.
What I have only retrieves the selected row number
How do I retrieve the contents of the row number as text.
Both .Value and .ListIndex return the row number only.

Thanks
Carol

With lstFullName
If MultiSelect = 0 Then
intRowNumber = .ListIndex
txtSelected = .Value
Debug.Print txtSelected & " value from Option list"
Debug.Print intRowNumber & "rn from Option list"
End If
End With
 
T

tina

those properties return the value in the Bound column of a listbox. to get
the value from another column in the listbox, use the Columns property, as

Me!ListboxName.Column(1)

note that listboxes columns, like those in combo box controls, have a
zero-based index. so the first column in the listbox is .Column(0), the
second column is .Column(1), the third column is .Column(2), etc.

hth
 
G

Guest

Hi, I am having trouble getting my combo box to dislay the correct data in
the field on the form - the correct data has been saved to my table, but is
not displayed on the form. How do I fix this one?

Thanks
Margo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top