Due to the similarity of your question I will ask - Is this a different question than your previous one? how to move a value of a cells in a
thread184-1703515
Or are you just trying to approach your previous question by using a different method?
The value of the selected item in a listbox is contained in its Value property. So, to replace a field (in a table) with that value, you do something like this:
SELECT TheTable
REPLACE TheField WITH THISFORM.List1.Value
I'm assuming there is only one column in the listbox. Is that right?
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
The short variant is to set the listbox controlsource to the field you want to set to the selected item additional to setting the rowsource and rowsourcetype to the list of items to choose from. That does not need any code.
In Short: If your listbox already displays items, you most probably only need to set the controlsource to TheTable.TheField you want to be set to the chosen value. Then set BoundTo = .T. and in case of a multi column listbox specify which column to copy into the controlsource field via BoundColumn number.
You should look at some basic sample code in the solution samples coming with VFP. Start the Task Pane from the Tools menu. In it's toolbar you'll find "Solution Samples". You can either search with key words in sample descriptions, or brows by category via the treeview. In caase you need to learn about a certain control, I'd expand the "Controls" nodee and in this case the subnode "Listbox", where you find several samples.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.