Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Boxes
Message
From
07/07/1999 03:56:01
 
 
To
06/07/1999 14:10:43
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00236835
Message ID:
00238147
Views:
24
Hi James.

>> Is your controlsource the cursor table.field created by the rowsource. <<

Nope. As a matter of fact, you do NOT want to bind the combo box to the same table it uses as its RowSource because this will cause you no end of problems. Generally speaking, the combos I use usually use some kind of lookup table (or cursor built from a sql statement that uses a subset of a particular lookup table) for their RowSources. The controlSource is then some field in a table or view that uses a value from the combo's RowSource.

The point that I was making to Sarah is that, when you put a combo in a grid, you have a special case. You usually want to replace a foreign key value in the table that the combo is bound to with the primary ket from ther combo's RowSource. When you are displaying the descriptions associated with the key inside the grid, this becomes problematic. That is why, in cases like this, I create a local view to use as the grid's recordSource and use the description as the controlSource (and bound column) for the combo. In order to update the foreign key value in the grid's recordSource with the correct primary key value from the combo's RowSource, I just add a little code to the combo's valid.

This way I can display english type descriptions in the grid and leave the column's sparse setting at .T. Setting it to false so that you have combo's in every row is ugly anyway.

I hope this helps. If not, let me know and I'll dig up some sample code to post for you.

Marcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform