Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric key, combo, vfp3
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Numeric key, combo, vfp3
Miscellaneous
Thread ID:
00056045
Message ID:
00056045
Views:
67
People warned me about using numeric keys in vfp3 and then trying to use them with combos, but nooooooooo, I wouldn't listen. I made my keys a DOUBLE field, hoping to upgrade to vfp5 soon, not really understanding what would go wrong, and figuring I could find a workaround. I have a couple of groups of tables related many-to-many, table3 being a child of table1 and table2, and containing the parent keys to both. In a typical form, I have table1 in the controls, and a view joining table2 and table3 in a grid. One of the columns of the grid has controlsource = table3_id field. This column has a combo (drop-down list) that has columns showing descriptive fields from table3. The rowsource is a SQL of fields from table3, which looks like SELECT field1, field2, table3_id, fieldlast FROM table3 INTO CURSOR dummy ORDER BY fieldlast. The combo.BoundColumn is the column having table3.table3_id (3 in the above example). In one form, it is working, but in another, the combo puts the wrong key value in the cursor. If the wrong key value is found in table3, the grid will display the other fields for that incorrect key. If the wrong value doesn't happen to be in table3, of course the trigger fails. But if I try to select another value in the combo, the drop down list goes to the correct item, as if it knows what the correct one is, even if I exit and re-enter vfp. None of the other fields have a similar 4 digit number, and it is not accidentally substituting the table1_id for the table3_id. There are two things obviously different about the one that doesn't work. First, it has several columns in the combo. The working one has only two. Second, the grid has other columns whose controlsources are fields in the view which came from fields in table3 identical to fields shown in the combo. I did this because I need to display multiple descriptive fields from table3, and a combo can only have one displayvalue.

I don't know if numeric keys make combos inconsistent, or if the combo columns and grid columns are getting in each other's way, or what. If this system can't work, I need a workaround. I really don't want to have to convert my keys to characters at this stage. Thank you for your patience reading yet another long question.
Next
Reply
Map
View

Click here to load this message in the networking platform