Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox with changing contents
Message
From
20/09/1999 19:38:03
 
 
To
20/09/1999 16:23:55
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00266892
Message ID:
00266933
Views:
20
>Hello,
>I'm trying to figure out how to do it the most easy and straightforward way (as always :-)):
>I have a combobox, which I fill with a Cursor.
>SELECT This from That WHERE ThisField = ThatVariable INTO CURSOR WellWell
>
>Rowsourcetype = 2, Rowsource = "WellWell"
>
>Now, The contents of this Cursor have to change sometimes due to the change of the variable "ThatVariable", so should the contents of the Combobox.
>
>However, I don't like the approach to make the SQL again, then to fill (or Requery?) the combobox again with it's contents.
>
>I could use instead of a Cursor a parameterized view, and I guess this view will be refreshed automatically when I trigger the Combo.Requery() event.
>
>But I am not very experienced with comboboxes, so what is the easiest way of doing "it" according to more experienced programmers?

If you use View, you still need in 2 requeries.
=Requery("myview")
Mycombo.Requery

The point is that cursor is more suitable for combo, because here you don't need in updatable recordset, buffering and all other view 'fringes'. Using cursor, you don't have to 'dirty' DBC with extra view definitions, don't worry about data sessions etc. Even more, if you have small number of combo items, then the most suitable way is to use AddItem.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform