Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6SP5 - Unselect Combo selection
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00795134
Message ID:
00795668
Views:
69
Internally I want the thing to be connected using an iID a unique integer.

Combo boxes are particularly powerful controls because they enable you to display descriptive text from a lookup table while binding the control to its associated key value. This is possible only because the combo box has both a Value property and a DisplayValue property. Understanding the role each of them plays can be confusing, to say the least.

DisplayValue is the descriptive text that is displayed in the textbox portion of the control. This is what you see when the combo box is "closed." The combo's DisplayValue always comes from the first column of its RowSource. On the other hand, the combo's Value comes from whichever column is specified as its BoundColumn. If the BoundColumn of the combo box is column one, its Value and DisplayValue are the same when the user picks an item from the list. When the control's BoundColumn is not column one, these two properties are not the same.

This code merely selects the item in the combo box where the items in the first column matches what the user typed in so far
IF UPPER( .List[ lnRow, 1 ] ) = UPPER( lcSoFar )
  .ListIndex = lnRow
  EXIT
ENDIF
The combo's ControlSource will be updated approriated depending on which column is the BoundColumn. I would assume that your integer surrogate PK would be in the BoundColumn < s >.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform