Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why 'Thisform can only be used in method' error?
Message
 
 
To
29/06/2003 21:40:59
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00805151
Message ID:
00805163
Views:
44
Jim,

It's because you are not inside a form method while the SQL is actually executing. It's the same thing experienced by p-views where the parameter is an object property. For p-views I use code like:

* p-view parm ... somefield = ?lcSomeField
lcSomeField = thisform.txtSomeField.Value
Requery( "theView" )

In the LostFocus() of the cbo1 you can reset the RowSource of cbo2 to use the current value of cbo1
with this.parent.cbo2.RowSource
   .RowSource - ... + this.Value + ...
   .Requery()
endwith
>A simple form presently with only 2 comboboxes.
>
>The second is dependent on the value in the first, so with a RowSourceType of 3 (SQL) I have "...WHERE BINS = ThisForm.FirstCombo.Value ..." in the RowSource's SQL command.
>
>Doing so results in the error message "Thisform can only be used in method" and the question is WHY?
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