General information
Category:
Forms & Form designer
Mark;
I have to agree with you and tried this back in the VFP 3.0 days. It is not stable. I recall a statement made about combo boxes in 1995, "There are ten ways to use a control source with a combo box. Three of them work"! :)
Tom
>IMHO, using a private memvar as the ControlSource is a bad idea. I would add a property to the combo and use that property as the ControlSource. If you need something more globally visible, add a property to your global app object and use that.
>
>For further stability, I prefer a SQL statement or an array as the RowSourceType for the array. If I use an array, I use an array property of the combo, which I have already added to my combo subclass.
>
>I have an example of a combo class in the UT downloads that can also be used to add new records to the source table if the combo is used as a dropdown combo.
>
>>This should be simple, but obviously isn't...
>>
>>I have a combo box on a form that has two columns showing the contents of a foreign table. The first column is the description, the second is the code, which is numeric. The BoundColumn property is set to 2 and the BoundTo property is set to True to get it bind. The ControlSource is a private memory variable. The row source is an Alias.
>>
>>Fine so far. It accepts the selection that I make. However, it won't show the description (column 1) until I save the changes. 'Ah ha' I hear you cry, you must set DisplayValue to 1 to force that column to be shown....'Ah ha ughhhh' I reply...done it..and seen some of the weirdest behaviour in a language I've seen since I used DataEase years ago. Display value works...once! and then it doesn't. If I modify the form in any way it sets the DisplayValue to 0 and I'm back to square one.
>>
>>I understand from my colleague, who has been using FoxPro for some years, that combo boxes are a bit weird when bound. How the hell else do you use them??? He's just showed me his usual way of using cb's and it's stoneage...
>>
>>Please tell me there is a simple work around...my sanity and productivity depends on it.
>>
>>Thanks in advance..
>>
>>Pablo
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