Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change value in combo
Message
De
15/04/2001 13:26:25
Ben Dekker
Dekker Soft & Hardware
Axel, Pays-Bas
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00494464
Message ID:
00495660
Vues:
11
Hi Ko

>The simplest way to archieve this is to have a combobox to select the user, and a textbox to eventually change the name.
>
>Another way is to use a view with all the names in the rowsource.
>Set the rowsourcetype to View, and in the Rowsource place
Select name from users into cursor cNames
>Then you don't have the problem that the list from which you select a value is the same as the table where the data is written to.
>In the valid event you can place the following code:
>
 * Combobox.valid()
>SELECT USERS
>IF NOT EMPTY( This.DisplayValue ) && Only if the display value is not empty searching is needed
>   If This.ListIndex = 0  && First look if the value already exists in the list
>      && If not, then replace the name with the new value
>      REPLACE Users.Name with This.DisplayValue
>      && Then requery the view with the list of names in it. (This is the view from the rowsource)
>      Requery('cNames')
>      && The last thing needed is to requery the combo itself. By doing this the list with names in the combo will be updated.
>      This.Requery()
>   ELSE
>      && If the value is in the list, we can simply look up the requested user.
>      SEEK This.DisplayValue
>   ENDIF
>ENDIF
>
Sorry but I have got lots of solutions

Don't use the same name in rowsource and controlsource and I got lots of
kinds combox.valid() The one is worst then the other. But the combo is not working at all. The only problem I have with my on combo is I can't change
a value in the table. The rest is working fine. It should be wrong but what most a beginner do to solf this problem??

Ben
Greetings

Ben Dekker
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform