Here is a bug in Visual Foxpro:
Make up a form with a combo box. Base it on a table with two fields; first one for for a numeric code (integer type), the other a description (character type). Add a view to the DataEnvironment, with an integer field call it, say, 'linked'.
For combobox, give a RowSourceType of Fields or an SQL based on the table. I want to display the description but return the numeric code, so 'table.number,description' or an SQL with 'SELECT description,number FROM table' will do for the RowSource. Now set the bound column to 2 and set the column count to 2. This is so it displays a description in the DisplayValue but returns a numeric code to the linked table: Control Source is 'view.linked'
The view.linked field will now have the RECNO() of the table *not* the numeric code. If you change the ControlSource to an ordinary variable it returns the right numeric code from the first column of the table.
It doesn't have to be a view BTW, it can also be a table.
Any suggestions?
Grant
----------------------
Grant Floyd
Phil Radford Consultants
email:
floydg@radcomp.co.nzphone (07) 5784576