Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
THISFORM can only be used within a method
Message
From
16/01/2007 13:23:31
 
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:
01185993
Views:
16
Hi Naomi,
>
>It could be a BoundTo problem which I stumbled myself few days ago.

I'll look into that - near to going home now.

>Also please convert date to unambigious format, suggested elsewhere in this thread. You can also use date = {} instead of an empty() function.

Yes I saw it. There's nothing ambiguous here as I have set date brit. The Trans() statement looks too complicated for decent readability for my liking

Cheers

Terry

>
>>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
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform