Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox loosing it's spot.
Message
De
11/07/2003 09:18:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00809009
Message ID:
00809175
Vues:
22
>I have a view that's being used as the RowSouce for a combobox. My problem is that the pointer location in the combobox doesn't match the record location in the view when I run this code.
>
>
>SELECT &lcView1Alias
>LOCATE FOR &lcView1Alias..Key_id = &lcView2Alias..Key_Id
>This.cboBox1.Value = &lcView1Alias..Name
>This.cboBox1.Refresh()
>LOCATE FOR &lcView1Alias..Key_id = &lcView2Alias..Key_Id
>
>
>The glitch is with the 3rd line of the code because &lcView1Alias.Name is not unique. If there are four 'names' that are the same, it always ends up on the first one once the 3rd line of code here is run, which is why the Locate is run again at the end. The problem is that now when a user clicks the downarrow on the combobox, it looks like they're sitting on the first 'name' instead of the one they selected. Anyone have any suggestions on how to fix this? (other than changing what cbobox1.value is? don't want to have to do that due to the amount of other code that would have to be changed).
>-thanks!

If rowsource is a view why are you playing with value. Just locate the record with unique key. You could even use the recno() as listindex :

LOCATE FOR &lcView1Alias..Key_id = &lcView2Alias..Key_Id
This.cboBox1.Listindex = recno()

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform