Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
THISFORM can only be used within a method
Message
 
 
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:
01185987
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
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
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform