PC Review


Reply
Thread Tools Rate Thread

copy values from ListBox to a TextBox

 
 
=?Utf-8?B?QnJ1bm8gQ29lbGhv?=
Guest
Posts: n/a
 
      31st Oct 2005
hi,
i'm trying to copy the values from one listbox to the textbox, how can i do
this?
the listbox just show one value. i have to use listbox because it is the
value from an SQL statement.
Any sugestion

 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      31st Oct 2005
There is no reason to create a list box for only one value, you can retrieve
the value using dlookup, or any other method
If you tell us what you are trying to do, mybe we can help you and recommand
a different method

To copy from a list box, you need to select the record and then
Me.TextBoxName = Me.ListBoxName
--
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



"Bruno Coelho" wrote:

> hi,
> i'm trying to copy the values from one listbox to the textbox, how can i do
> this?
> the listbox just show one value. i have to use listbox because it is the
> value from an SQL statement.
> Any sugestion
>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJ1bm8gQ29lbGhv?=
Guest
Posts: n/a
 
      31st Oct 2005
hi again,
i have a list box, that have a list with the names, and when i select one
name it appear the code (Listbox), i use a listbox because i can't retrieve
the value with the select statement, from the listbox names. if you know
other way to get the value without using listbox, i will aprecciate.
thanks

"Ofer" escreveu:

> There is no reason to create a list box for only one value, you can retrieve
> the value using dlookup, or any other method
> If you tell us what you are trying to do, mybe we can help you and recommand
> a different method
>
> To copy from a list box, you need to select the record and then
> Me.TextBoxName = Me.ListBoxName
> --
> 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
>
>
>
> "Bruno Coelho" wrote:
>
> > hi,
> > i'm trying to copy the values from one listbox to the textbox, how can i do
> > this?
> > the listbox just show one value. i have to use listbox because it is the
> > value from an SQL statement.
> > Any sugestion
> >

 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      31st Oct 2005
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
--
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



"Bruno Coelho" wrote:

> hi again,
> i have a list box, that have a list with the names, and when i select one
> name it appear the code (Listbox), i use a listbox because i can't retrieve
> the value with the select statement, from the listbox names. if you know
> other way to get the value without using listbox, i will aprecciate.
> thanks
>
> "Ofer" escreveu:
>
> > There is no reason to create a list box for only one value, you can retrieve
> > the value using dlookup, or any other method
> > If you tell us what you are trying to do, mybe we can help you and recommand
> > a different method
> >
> > To copy from a list box, you need to select the record and then
> > Me.TextBoxName = Me.ListBoxName
> > --
> > 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
> >
> >
> >
> > "Bruno Coelho" wrote:
> >
> > > hi,
> > > i'm trying to copy the values from one listbox to the textbox, how can i do
> > > this?
> > > the listbox just show one value. i have to use listbox because it is the
> > > value from an SQL statement.
> > > Any sugestion
> > >

 
Reply With Quote
 
=?Utf-8?B?QnJ1bm8gQ29lbGhv?=
Guest
Posts: n/a
 
      31st Oct 2005
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

"Ofer" escreveu:

> 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
> --
> 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
>
>
>
> "Bruno Coelho" wrote:
>
> > hi again,
> > i have a list box, that have a list with the names, and when i select one
> > name it appear the code (Listbox), i use a listbox because i can't retrieve
> > the value with the select statement, from the listbox names. if you know
> > other way to get the value without using listbox, i will aprecciate.
> > thanks
> >
> > "Ofer" escreveu:
> >
> > > There is no reason to create a list box for only one value, you can retrieve
> > > the value using dlookup, or any other method
> > > If you tell us what you are trying to do, mybe we can help you and recommand
> > > a different method
> > >
> > > To copy from a list box, you need to select the record and then
> > > Me.TextBoxName = Me.ListBoxName
> > > --
> > > 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
> > >
> > >
> > >
> > > "Bruno Coelho" wrote:
> > >
> > > > hi,
> > > > i'm trying to copy the values from one listbox to the textbox, how can i do
> > > > this?
> > > > the listbox just show one value. i have to use listbox because it is the
> > > > value from an SQL statement.
> > > > Any sugestion
> > > >

 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      31st Oct 2005
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)

--
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



"Bruno Coelho" wrote:

> 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
>
> "Ofer" escreveu:
>
> > 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
> > --
> > 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
> >
> >
> >
> > "Bruno Coelho" wrote:
> >
> > > hi again,
> > > i have a list box, that have a list with the names, and when i select one
> > > name it appear the code (Listbox), i use a listbox because i can't retrieve
> > > the value with the select statement, from the listbox names. if you know
> > > other way to get the value without using listbox, i will aprecciate.
> > > thanks
> > >
> > > "Ofer" escreveu:
> > >
> > > > There is no reason to create a list box for only one value, you can retrieve
> > > > the value using dlookup, or any other method
> > > > If you tell us what you are trying to do, mybe we can help you and recommand
> > > > a different method
> > > >
> > > > To copy from a list box, you need to select the record and then
> > > > Me.TextBoxName = Me.ListBoxName
> > > > --
> > > > 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
> > > >
> > > >
> > > >
> > > > "Bruno Coelho" wrote:
> > > >
> > > > > hi,
> > > > > i'm trying to copy the values from one listbox to the textbox, how can i do
> > > > > this?
> > > > > the listbox just show one value. i have to use listbox because it is the
> > > > > value from an SQL statement.
> > > > > Any sugestion
> > > > >

 
Reply With Quote
 
=?Utf-8?B?QnJ1bm8gQ29lbGhv?=
Guest
Posts: n/a
 
      31st Oct 2005
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



"Ofer" escreveu:

> 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)
>
> --
> 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
>
>
>
> "Bruno Coelho" wrote:
>
> > 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
> >
> > "Ofer" escreveu:
> >
> > > 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
> > > --
> > > 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
> > >
> > >
> > >
> > > "Bruno Coelho" wrote:
> > >
> > > > hi again,
> > > > i have a list box, that have a list with the names, and when i select one
> > > > name it appear the code (Listbox), i use a listbox because i can't retrieve
> > > > the value with the select statement, from the listbox names. if you know
> > > > other way to get the value without using listbox, i will aprecciate.
> > > > thanks
> > > >
> > > > "Ofer" escreveu:
> > > >
> > > > > There is no reason to create a list box for only one value, you can retrieve
> > > > > the value using dlookup, or any other method
> > > > > If you tell us what you are trying to do, mybe we can help you and recommand
> > > > > a different method
> > > > >
> > > > > To copy from a list box, you need to select the record and then
> > > > > Me.TextBoxName = Me.ListBoxName
> > > > > --
> > > > > 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
> > > > >
> > > > >
> > > > >
> > > > > "Bruno Coelho" wrote:
> > > > >
> > > > > > hi,
> > > > > > i'm trying to copy the values from one listbox to the textbox, how can i do
> > > > > > this?
> > > > > > the listbox just show one value. i have to use listbox because it is the
> > > > > > value from an SQL statement.
> > > > > > Any sugestion
> > > > > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Userform ListBox AND TextBox values Jock Microsoft Excel Programming 1 25th Jan 2010 04:36 PM
copy unique values into listbox, then modify sheet from these values Matthew Dyer Microsoft Excel Programming 4 28th Sep 2009 04:11 PM
Copy selected values from listbox to textbox =?Utf-8?B?TVNVIFNwdG4=?= Microsoft Access 3 5th Apr 2005 07:03 PM
Moving listbox item from listbox to listbox Kevin Quigley Microsoft Dot NET 2 2nd Jun 2004 11:34 AM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Microsoft Excel Programming 0 22nd Oct 2003 12:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:37 AM.