Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo - Listbox
Message
From
25/11/2001 08:20:15
 
 
To
24/11/2001 19:48:06
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00585457
Message ID:
00585482
Views:
19
Hi Geoff.

>> This works fine except when I select the row I want it displays the contents of column 1 instead of column 2 (displays the Stno but I want the Street) in the text portion. <<

This is exactly what I would expect to happen. The combo's DisplayValue (what is displayed when the combo is "closed") always comes from column 1 of its RowSource.

Specifying column 2 as the BoundColumn just tells the ControlSource which column it should update its value from. IMHO, that is what makes combos so useful. We can set the ControlSource to a (surrogate) foreign key value in a lookup table while displaying the meaningful descriptive text that is associated with it.

If you want to display the street number and address in column 1, change the RowSourceType to 3-SQL and change the RowSource to something like this:

SELECT PADR( ALLTRIM( stno ) + ' ' + ALLTRIM( street ), 35 ) DispStreet, stno, strret FROM cust INTO CURSOR fred

and adjust the BoundColumn accordingly.

HTH.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform