Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / October 2005

Tip: Looking for answers? Try searching our database.

copy values from ListBox to a TextBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bruno Coelho - 31 Oct 2005 14:30 GMT
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
Ofer - 31 Oct 2005 15:17 GMT
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
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,
> 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
Bruno Coelho - 31 Oct 2005 15:51 GMT
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

> There is no reason to create a list box for only one value, you can retrieve
> the value using dlookup, or any other method
[quoted text clipped - 10 lines]
> > value from an SQL statement.
> > Any sugestion
Ofer - 31 Oct 2005 16:02 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.