Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox error using cursor
Message
From
16/03/1999 12:51:43
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00198175
Message ID:
00198208
Views:
21
Nick-
That's because the variable no longer exists when the method is done. Instead, you can create a custom property of the form called lc_mainKey instead and assign the value to that. Then change your select statement to be
where sub_key.main_keys = thisform.lc_mainkey
>I am trying to create a combobox that will display values from a cursor but I key getting errors. My problem starts with the cursor. When I create cursor based on a variable from another field:
>
>if int(val(thisform.cboMainkey.value)) > 0
> thisform.cboSubkey.visible = .t.
> lc_mainkey = int(val(thisform.cboMainkey.value))
> select sub_key.sub_key, sub_key.sub_vendor from sub_key;
> where sub_key.main_keys = lc_mainkey into cursor hldsubkey
> thisform.cboSubkey.rowsource = 'hldsubkey'
> thisform.cboSubkey.rowsourcetype = 2
>else
>thisform.cboSubkey.visible = .f.
>endif
>
>lc_mainkey is a variable containing a value of another combobox. I am trying to create a second combobox based on cursor created above. However I get errors saying it cannot find variable LC_MAINKEY. How else can I create a combobox based on another field value? Is my rowsouce wrong or is it not possible to create cursor based on variables? Help greatly appreciated
>
>Nick Patel
Previous
Reply
Map
View

Click here to load this message in the networking platform