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 08:31:35
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
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:
01186206
Views:
17
>>>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)"
>>>
>>
>>What's type of operator? If it's a number and This is a combo, then just remove the alltrim and replace it with a transform(). If operator is a string, you'd need
>>
>>
>>lcFilter	= "OPERATOR = [" + ALLTRIM( this.Value) + "] and " + ;
>>	  "END_DATE >= CTOD('" + DTOC( thisform.dStartDate) + "') or EMPTY( END_DATE)"
>>
>
>Like I said, it keeps flip-flopping from char to num. I make a change accordingly then next time it decides it's the other!

Then stick to the type of Operator field, and serve it in that format. Alltrim(transform(this.value)) will always be a string, and the brackets around it would be necessary if Operator is a string.

Could it be that this.value is different during combo's init, before it's first refreshed? Maybe using eval(this.controlsource) would be better?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform