Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List boxex & Column Selection (2)
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00057607
Message ID:
00057609
Views:
31
>Sorry about the last message, big fingers send it... :)
>
>I have a list box with 3 columns. It is populated with name, address, city. What I need to be able todo is to click on a item (line) in the list box and pull out the address & city. The list box seems to be bound to column1.
>
>I tried the following:
>
>this.parent.ltMultiSelection.BoundColumn = 2
>tvRefe = this.parent.ltMultiSelection.value
>this.parent.ltMultiSelection.BoundColumn = 3
>tvDivi = this.parent.ltMultiSelection.value
>set filter to (datafile.fmem_refe = tvRefe) .and. (datafile.fmem_divi = tvDivi)
>
>Any ideas?
>
>Thanks in advance.
>
>
>James

The idea of listbox is following: when you select a item, you actually move record pointer to particular record of List.RowSource (assuming that you use Alias/Field as rowsource). Therefore, it's enough to retrieve field value from the rowsource:
Select Table1
? table1.address+table1.city
Sometimes, you want to be more confident about the results, then you bind value to Table1.PrimaryKey, seek for it, and then retrieve values:
Select Table1
Set order to Primarykey
Seek Thisform.List1.Value
If found()
cResult=table1.address+table1.city
Else
=messagebox("Invalid Value")
Endif
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform