Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

making one dropdown dependent on another

14 views
Skip to first unread message

skoal...@gmail.com

unread,
Nov 16, 2012, 9:25:20 AM11/16/12
to
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

unread,
Nov 16, 2012, 10:50:55 AM11/16/12
to
Hi skoalnreds,
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

skoal...@gmail.com

unread,
Nov 16, 2012, 11:04:10 AM11/16/12
to
Thanks, but I'm afraid I don't know what you mean by a "Form Property"?

Dan Freeman

unread,
Nov 16, 2012, 8:57:58 PM11/16/12
to
skoal...@gmail.com explained :
> 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


skoal...@gmail.com

unread,
Nov 26, 2012, 9:36:45 AM11/26/12
to
Got it. Thank you!
0 new messages