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.
Bye, Olaf.