Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo
Message
De
09/04/2004 09:36:46
 
 
À
08/04/2004 08:30:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: Combo
Divers
Thread ID:
00893230
Message ID:
00893526
Vues:
23
Hi Jeffrey.

Based off the company, I would like for my users to select from a list only those personnel within that company who they want to runreports for. Can anyone assist?

What you need to do is set up the combos so that the RowSOurce of the Personnel combo is dependent on the selection in the companies combo, something like this. You want to set up the RowSOurce of the personnel combo in the form's init() so that you can be sure that both combos (company and personnel) have already been instantiated:
*** Set up the SQL statement to use as the RowSource for the personnel combo box
*** Select only the items that have a CompanyID equal to the Item selected in the company combo box
lcRowSource = 'SELECT EmployeeName, EmployeeID FROM Personnel '
lcRowSource = lcRowSource + 'WHERE Personnel.CompanyID = ( Thisform.cboCompany.Value ) INTO CURSOR csrPersonnel '
*** Now set up the combo box's properties
WITH Thisform.cboPersonnel
  .BoundColumn = 2
  .BoundTo = .T.
  .RowSourceType = 3
  .RowSource = lcRowSource
  *** Don't forget to repopulate the control's internal list
  .Requery()
  *** Inialize it to display the first item
  .ListIndex = 1
ENDWITH	
Then, in the Valid() of the companies combo, you just requery() the personnel combo.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform