Discussion:
making one dropdown dependent on another
(too old to reply)
s***@gmail.com
2012-11-16 14:25:20 UTC
Permalink
Hi, I'm very new to VFP and GUI design. I have a item_master table which stores, among other things, a "category" and "subcategory" fields. In my main form, I want these two fields to be editable using dropdowns, but I want to narrow the subcategory dropdown to be the appropriate subcategories for the category chosen. The permissible choices for category and subcategory are in separate tables. Can somebody point me in the right direction? I've tried using a query for the rowsource but it doesn't like the way I reference the value in the first dropdown. I've also tried storing the choice in the first dropdown to a variable then using that variable as the WHERE in my query when the second dropdown gets focus, but it errors saying the variable doesn't exist. I know this must be very easy, but I would appreciate some help. Thank you.
Bernhard Sander
2012-11-16 15:50:55 UTC
Permalink
Hi skoalnreds,
Post by s***@gmail.com
Hi, I'm very new to VFP and GUI design. I have a item_master table which
stores, among other things, a "category" and "subcategory" fields. In my
main form, I want these two fields to be editable using dropdowns, but I want
to narrow the subcategory dropdown to be the appropriate subcategories for
the category chosen. The permissible choices for category and subcategory
are in separate tables. Can somebody point me in the right direction? I've
tried using a query for the rowsource but it doesn't like the way I reference
the value in the first dropdown. I've also tried storing the choice in the
first dropdown to a variable then using that variable as the WHERE in my
query when the second dropdown gets focus, but it errors saying the variable
doesn't exist. I know this must be very easy, but I would appreciate some
help. Thank you.
Instead of a variable use a form property to store the value from the first
dropdown.
Or, where you store the value from the first dropdown, refresh the second
dropdown immediately.

By default, variables are private. This means, if the procedure, that defines
the variable is finished, the variable will automatically be deleted from memory.

Regards
Bernhard Sander
s***@gmail.com
2012-11-16 16:04:10 UTC
Permalink
Thanks, but I'm afraid I don't know what you mean by a "Form Property"?
Dan Freeman
2012-11-17 01:57:58 UTC
Permalink
Post by s***@gmail.com
Thanks, but I'm afraid I don't know what you mean by a "Form Property"?
From the "Form" menu, choose "New Property". Give it a name you can
remember, like "MyNewProperty". From then on, refer to it as:

thisform.MyNewProperty

Dan
s***@gmail.com
2012-11-26 14:36:45 UTC
Permalink
Got it. Thank you!

Continue reading on narkive:
Search results for 'making one dropdown dependent on another' (Questions and Answers)
6
replies
What are the real advantages of Macs over PCs?
started 2007-04-07 13:53:03 UTC
computers & internet
Loading...