Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
THISFORM can only be used within a method
Message
From
17/01/2007 11:25:12
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01185055
Message ID:
01186309
Views:
21
You can mark it as help. :o)


>Hi Naomi
>
>Yes I think that might be it. On one of the combos I falsified the .BoundTo and now they're ALL behaving. Go figure. Thanks a lot - something so simple (I don't mean you! :-) can save a lot of grief.
>
>Thanks for all the input and time the rest of you.
>
>Can't give stars here as this isn't the soln. to the orig problem :-)
>
>Terry
>
>>Hi Terry,
>>
>>It could be a BoundTo problem which I stumbled myself few days ago. Also please convert date to unambigious format, suggested elsewhere in this thread. You can also use date = {} instead of an empty() function.
>>
>>>Thanks for all the input on this one, guys. Sorry I haven't got back sooner but the UT's been out of order for me this PM. The filter code appears in a few places on the form and I've got round the problem sort of in this way:
>>>
>>>
>>>lcFilter	= "OPERATOR = " + ALLTRIM( this.Value) + " and " + ;
>>>	  "END_DATE >= CTOD('" + DTOC( thisform.dStartDate) + "') or EMPTY( END_DATE)"
>>>
>>>
>>>Trouble is now that VFP can't seem to make up it's mind what data type my combo value is. I'm getting batted from pillar to post in that: first it gives me a value, func, arg error on the " + ALLTRIM( STR( this.Value)) + ", cos the operator code, value from the combo is supposed to be numeric, but this.Value shows up in debug as, say, " 5" rather than 5.
>>>
>>>OK says I, and I change it to " + ALLTRIM( this.Value) + " as above.
>>>
>>>Then later I get another value, func, arg error cos the value is now 5!!!! I can't win!
>>>
>>>Similar is happening to the textbox, in which I copy the code extracted from the combo (the operator can be selected either by typing in its code in a text box or selecting from the combo. Eithe rmethod needs to update the other with the selected value.
>>>
>>>Now I've initialised their values appropriately with 0 in the props.
>>>
>>>I've come across this problem before but I can't recall the soln.
>>>
>>>Cheers
>>>
>>>Terry
>>>>I know - that old chestnut
>>>>
>>>>I've made some changes to a form and since, whenever I click on a particular combo, the first time, I get:
>>>>
>>>>"THISFORM can only be used within a method".
>>>>
>>>>I've tried to trace where in debug, even to putting some dummy code in the combo's .GotFocus(), but it follows the code then the message appears from nowhere. Now, I have no code outside the form's methods, referenced anywhere in the form, that includes "Thisform", nor is that the among any of the changes I made. The 2nd time I click on the combo it behaves properly.
>>>>
>>>>The only code I have in the combo is in the .InteractiveChange() and this isn't reached (in debug) before the error message.
>>>>
>>>>I was using some "thisform.cRouteNo" in a filter string , and in an SQL statement, which I vaguely remember VFP7 doesn't like, so first loaded a method var with this and substitued this in the strings, but made no difference (and indeed these snippets aren't reached first anyway.
>>>>
>>>>This has got me baffled. Any ideas
>>>>
>>>>'ppreciate it
>>>>
>>>>Terry
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform