If you have a list of names, and you select just one of them, to move the
value selected in the list box to the text box use the After update event of
the ListBox and write the code
Me.TextBoxName = Me.ListBoxName
Now, if the list box contain more then one field, and you want to transfer
the second field, then use this
Me.TextBoxName = Me.ListBoxName.column(1)
The column number count start with 0

Signature
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
> hi again,
> i have a list box, that have a list with the names, and when i select one
[quoted text clipped - 17 lines]
> > > value from an SQL statement.
> > > Any sugestion
Bruno Coelho - 31 Oct 2005 16:20 GMT
hi, it didn't work, i will explain better
i have a table with this fields----> Name, code, adress
now i have a listbox with all the names in the table and when i select one
of them i want in the code, adress listbox appear the values corresponding to
the name. i use the listbox, because, i am using an SQL statement to check
the values of the code and the adress. if try with the texbox it don't appear
nothing, so if you know how to get the value from the name selected to a
testbox.
thanks
> If you have a list of names, and you select just one of them, to move the
> value selected in the list box to the text box use the After update event of
[quoted text clipped - 29 lines]
> > > > value from an SQL statement.
> > > > Any sugestion
Ofer - 31 Oct 2005 16:45 GMT
Let start from the beginning
1. Create a list box that include all the fields in the table
Select [Name], code, adress From TableName
You don't need to display all the fields in the list box, you can display
only the name
2. On the after update event of the lsit box, write
Me.TextBoxName = Me.ListBoxname.Column(2)

Signature
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
> hi, it didn't work, i will explain better
> i have a table with this fields----> Name, code, adress
[quoted text clipped - 39 lines]
> > > > > value from an SQL statement.
> > > > > Any sugestion
Bruno Coelho - 31 Oct 2005 17:26 GMT
hi, it works, but idid in other.
now i have a textbox that will receive the code, but to receive i have to
click in the listbox of the code, how can i do to the textbox receive the
value automaticly without press the lisbox. thanks
> Let start from the beginning
> 1. Create a list box that include all the fields in the table
[quoted text clipped - 49 lines]
> > > > > > value from an SQL statement.
> > > > > > Any sugestion