Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove items from one list to another when bound to a ta
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01075202
Message ID:
01075276
Vues:
23
>I am designing a new form which allows a user to be assigned to groups. Therefore when you double click the user a form is presented with 2 listboxes. The first listbox is a list of available groups (listbox) bound to a table. The 2nd listbox is a list of groups the user is assigned to. Its a like to mover class. When you click on a group to add the user to I select the usergroups table which appends a new record and adds the user and group to the table and then refresh the listbox. This works great. Only that the group is not removed from the available groups is this is a list from a table. How can I do this so that when you select a group it removes from list one and shows in list 2?

Use a query to select all the available records from your table into a cursor. Use the cursor as the data source of the listbox. When a choice is selected, delete that record from the cursor, and call the listbox's Requery method.

Why not just use a mover class? They are fairly easy to use, populate and get choices returned to you in an array to process. You will probably write less code to use this class than you would to make your current method work.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform