Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box/Views
Message
De
14/04/1999 23:15:05
 
 
À
14/04/1999 13:29:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00207519
Message ID:
00208459
Vues:
23
Hi John -

I spent all night working on my form and made good progress. It isn't working yet, but I have no doubt I will get it with dedication and perseverance!

I feel very squared away with the code you sent me today. I would like to write out what I did and see if you can catch where I am "taking on water".

1. I added two form properties at the form level called CurrentState and CurrentCounty. I changed their default from .F., to blank, so that the textbox reads (NONE).

2. I went to my state combo box, in the interactivechange event and placed the code>

THISFORM.CurrentState = This.Value
=REQUERY("county_search") && name of my p-view for my county combo
=REQUERY("locality_search") && name of my p-view for my city combo
THISFORM.cmbcounty_search.refresh()
THISFORM.cmblocality_search.refresh()

3. I went to my county combo box, in the interactivechange event and placed the code>
THISFORM.CurrentCounty = This.Value
=REQUERY("locality_search")
THISFORM.cmblocality_search.refresh()

4. I then went to tackle my two p-views and this is where I see the iceberg dead ahead! I have created a p-view before (only 1), so I have not reached a comfort zone here.

P-view for my county combo (cmbcounty_search):

I placed an existing view I have in my app. called "counties", which I created for another form control. This view pulls all counties in my app. I placed it in the view data environment and then went to the command window to change the sql statement with a CREATE SQL VIEW..

My WHERE statement is> WHERE counties.cjurisstate = ?Thisform.CurrentState

** I chose cjurisstate, b/c that field holds the two letter abbreviation which the state combo box is showing above it (on my form). Since CurrentState = This.Value, if a user selects "FL" in the state combo, that has to be matched up with the county combo for that combo to only select counties in FL. That is my logic for that WHERE statement.


5. I then created my second p-view, for my locality (city) combo box. Originally, before i decided to be daring and do this, I had a simple view attached to this combo box that pulled all cities, but it didn't have the "county" anywhere in the view. So, I created a new view from scratch using different tables. I placed my JURISDICTIONS talbe and COUNTY SUBORDINATE ASSIGNMENT table into the view designers DE.

My WHERE statement reads>

WHERE jurisdicitons.cjurisstate = ?THISFORM.CurrentState AND ;
jurisdictions.cjurisname = ?THISFORM.CurrentCounty

** I chose cjurisstate for the same reason as above. That field holds the two letter state abbreviation that has to match the state combo result, and the cjurisname field holds the name of the county the city is in, which has to match the county combo box.

6. My problems started when I went back to my form and started trying to attach the views to the combo box. I went to my county combo box and used the combo builder to select my "county_search" p-view. I selected "cjurisname" as the value to be displayed, which is the field that holds the county names.

I made sure the nodataonload was set to .T. for this view.

7. when I went to my next combo box, locality_search (city), FoxPro wouldn't let me use the builder. A form popped up prompting my to enter a parameter. So, I went to the properties window, to the rowsource and typed in>

locality_search.cjurisname

b/c I want the cities to be displayed in the drop down list, and that field holds the name of the cities.

I made sure the view was set to nodataonload = .T.

9. I then had to requery those two views in the init of my form, but i wasn't sure of the syntax

I typed:

requery("locality_search")
requery("county_search")


*** When I went to run the form it said ALIAS not found and wouldn't let me close the form. I had to shut down fox and reopen it to get rid of the form.

so, that is where I am!

If you see any place(s) where I need a help, I would sure appreciate an additional push.

Thanks in Advance

jason
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform