Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox selectedvalue

Status
Not open for further replies.

mimitan

Technical User
Dec 17, 2004
34
I have a listbox that display a select distinct field from SQL and I have a button when clicked, it supposed to copy the content of the listbox into a textbox, but it didnot, it seems like I have the select the value first then click copy. Is there a way to default it to automatically select the content of the listbox?
the code of my button clicked

Protected Sub CopyButton_Click()
Address.Text = OldAddressListBox.SelectedValue

Thank for help
 
Why do you need a listbox if there is only going to be 1 value in it?
 
The value I need (which a paragraph of text)is in the SQL table and I do not know how to assign it to a text box from SQL. So what I did is create a SQL datasource and have a listbox to grap that value (text string) then copy it to the text box.
 
There are many examples on line on how to grab data from the DB without using the datasource controls. Once you do that, it will be easy to assign the value to a textbox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top