Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subjective lists
Message
 
 
To
12/05/2002 16:49:03
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00655524
Message ID:
00655995
Views:
15
Shana,

Assuming you have two tables

Continent
ContinentID int
Name c(30)

With data like

1 North America
2 Europe
3 South America

Country
CountryId int
ContinentID int
Name c(40)

with data like

1 1 Canada
2 1 USA
3 1 Mexico
4 2 Germany
5 2 France
6 2 United Kingdom
7 3 Brazil
8 3 Peru

Have a ListBox with it's RowSource set to a Countries cursor. You can put the Continent data into a Combobox control, In the Valid() then:
* limit the countries to those in the currently selected continent
select CountryID, Name ;
   from Country ;
   into cursor Countries ;
   where ContinentID = this.Value ;
   order by Name

* update the listbox
with this.parent.lstCountries
   .Requery()
   .Refresh()
endwith
You can also use a parameterized view as Nadya suggests and the above SELECT reduces to a Requery( "countries" ), but that might be a little too much to start with.

>I'm trying make a certain list(free table) appear when the user makes a certain selection.
> i.e., when the user chooses "North America" in the first list, the next list will only display the countries in North America.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform