Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COMBO BOX BLUES - Help needed NOW!!!
Message
De
08/07/2002 18:16:37
 
 
À
08/07/2002 12:12:43
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00676177
Message ID:
00676391
Vues:
25
This message has been marked as the solution to the initial question of the thread.
Hello John.
Here are the particulars again.
2 Tables CurGrid1 - holds the information for display in the grid.
Driver - holds the drivers information keyed to driverid C(10)


OK. Here I am assuming that DriverID is the primary key in the driver lookup table and drv_sname is the name of the field that holds the driver description. Typically this is why people use combo boxes and this is what makes them so powerful: the fact that they have a DisplayValue. You can bind the combo to a key field while displaying meaningful text from a lookup table. OK, so, making that assumption:

  • you drop the combo into the grid column

  • set the column's CurrentControl to the combo box under the data table of the property sheet

  • leave the column's sparse property set to true

  • set the column's Bound property to false

  • set the column's controlSource up as: IIF( SEEK( cutGrid1.driverID, 'Driver', 'DriverID' ), Driver.drv_sname, '' )



Set up the combo box like this:

  • RowSourceType = 3-SQL

  • RowSource = SELECT drv_sname, driverid FROM Driver INTO CURSOR JUNK NOFILER

  • ControlSource = curGrid1.DriverID

  • BoundColumn = 2

  • Style = 2-DropDown List



Note: this technique will only work for a drop down list. If you need to use a drop down combo, please see the sample code in chapter 6 of 1001 Things You Wanted to Know About VFP or see my article in the February 2000 issue of FoxPro Advisor.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform