listbox select item

meme'1992

Registered User.
Local time
Today, 13:37
Joined
Apr 2, 2018
Messages
14
Hi,
I have a listbox , fill with a select. I want to select a value in the listbox and pass in another select.

Code:
Private Sub lista_persone_Click()
Dim tmpR As DAO.Recordset
Set tmpR = CurrentDb.OpenRecordset("SELECT Exam FROM Exam WHERE NAME_PERSON = '" & Me.lista_persone.Selected & "' ")
Me.txt_exam= tmpR.Fields(0)
End sub

But Me.lista_persone.Selected is wrong and gives me an error.
How can I select the value?
Thanks
 
you dont need the .value.

Me.lista_persone will give you the value of the first column, if there is more than one.

Me.lista_persone.column(1) will give you the value of the second column. the columns are zero based.
 
Yes, the columns are 3. How can assign to each colomn the value? I make a select and a recordset. Can I use fields of recordeset?
 

Users who are viewing this thread

Back
Top Bottom