General information
Category:
Forms & Form designer
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only