Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box/Views
Message
De
12/04/1999 14:30:06
 
 
À
12/04/1999 14:24:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00207519
Message ID:
00207522
Vues:
16
Create two form properties, CurrentCounty and CurrentState. In the interactivechange method of the State combo, change CurrentState to the Value of the combo. In the interactivechange of the County combo, ensure that the CurrentCounty property is changed to the combo Value.

Now, use parameterized views for the County and City combos; i.e.:

SELECT * FROM county WHERE state = ?THISFORM.CurrentState
SELECT * FROM city WHERE state = ?THISFORM.CurrentState AND county=?THISFORM.CurrentCounty.

By the way, set NoDataOnLoad to .T. in the Dataenvironment for those views and REQUERY() them in the init of the form.

Now, are you using VFP5 or 6? How I continue on this depends on that?


>
>I have stumbled upon a "search" form that I have a few questions:
>
>Scenario:
>
>I have a form called "Office Search Form". On this form are 4 combo boxes. They are the following:
>
>A. State:
>B. County:
>C. City:
>D. Office:
>
>When a user selects any one of these combo boxes, he/she currently is selecting the "default" view for that combo box. That is the way I have it set up now. For example, if you clicked on the "state" combo box, you would have a choice of Florida or Alabama. If you clicked on the "county" combo box, you would see all the "counties" for EACH state, etc.
>
>
>**** I would like to have the user select a specific state, be it Florida or Alabama, and have the following combo box [counties] reflect only the "counties" in the selected state......not both. Then, when the user selects the "county" he/she wants, the "cities" combo box only reflects the "cities" in the "county" that is chosen, not all cities that the VIEW is storing.
>
>
>I hope this is clear and those that are reading this understand what I am trying to accomplish.
>
>I would appreciate any feedback on how to develop/create my views or place code where I need to, in order to make this work.
>
>
>I just don't understand how to make this happen, when I already have a specific view tied to the combo box. There must be a way that as soon as "FL" is placed in the first box, an event is automatically fired that populates the view for the next combo box with correct information.
>
>TIA
>
>Jason
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform