I have a similar problem with a text box. The employee enters the first number of a purchase order and a form opens which allow him/her to either carry on typing or select from a list the purchase order they want to edit or view. In the key press the code calls the model form. On closing the form saves the PO. no. In a global object. The calling form searches for that PO. and then populates the form with the PO details. The last thing it does is fill the text box with the PO No. Whenever they search the text box fills with the 1st PO. No on the system. Watch in the debugger and the textbox has the right value in it then as you leave the Key Press method it reverts to the 1st PO No. I have had to leave the problem for now but will look at it again when time permits or someone comes up with a suggestion.
Cheers Peter Peter Hart Computers On Behalf Of Stuart Dunkeld Sent: 04 August 2009 13:00 Subject: Re: R: VFP9 SP2: Form caption strangeness If you add a debugger Watch on thisform.Caption and step through in the debugger, does the Watch expression change and revert back, or not change at all? --stuart On Tue, Aug 4, 2009 at 12:17 PM, Iames Pizzoli<[email protected]> wrote: > Dave, > > thanks for your try. But it isn't a scope/value problem. Look at > this: > --- > LPARAMETERS nColIndex > > *!* LOCAL lcTableItemExpression, lcTableItem > > *!* lcTableItemExpression = Thisform.icTableItemExpression > > *!* IF VARTYPE( lcTableItemExpression) = "C" AND NOT EMPTY( > lcTableItemExpression ) > *!* lcTableItem = EVALUATE( lcTableItemExpression ) > *!* > *!* lcTableItem = IIF( ISNULL( m.lcTableItem ), SPACE(0), ALLTRIM( > lcTableItem ) ) > *!* ENDIF > > *!* Thisform.Caption = lcTableItem > > Thisform.Caption = "zzzzzzzzzzzzzz" > > *thisform.DRAW() > > DODEFAULT( nColIndex ) > --- > > Now nothing should interfere, correct? Still it isn't changing. Seems like a > lock somewhere, the property not allowed to be modified. VERY strange! > > Iames > > >> -----Messaggio originale----- >> Da: [email protected] [mailto:[email protected]] Per >> conto di Dave Crozier >> Inviato: martedì 4 agosto 2009 12.00 >> A: 'ProFox Email List' >> Oggetto: RE: VFP9 SP2: Form caption strangeness >> >> Iames, >> I don't know what your lcTableExpression is but I tried this with a >> customer >> table with a field called ID and it worked fine: >> >> ************** >> * Start of Code >> * >> Check your lcTableItemExpression is in fact valid. >> >> LOCAL lcTableItemExpression, lcTableItem >> >> lcTableItemExpression = 'iif(Left(Customer.Id,1)=="A", "Starts with A", >> "Does Not start with A")' >> >> IF VARTYPE( lcTableItemExpression) = "C" AND NOT EMPTY( >> lcTableItemExpression ) >> lcTableItem = EVALUATE( lcTableItemExpression ) >> >> lcTableItem = IIF( ISNULL( m.lcTableItem ), SPACE(0), ALLTRIM( >> lcTableItem)) >> >> ENDIF >> >> Thisform.Caption = lcTableItem >> * >> * End of Code >> ************** >> >> Try and substitute and actual expression (Macro Subst) for the evaluate >> and >> see if that works first, but I think the problem will lie in the >> Evaluate >> such as accessing a different datasession or variable that it cannot >> see >> because of scoping. >> >> Dave Crozier >> >> >> -----Original Message----- >> From: [email protected] [mailto:[email protected]] On >> Behalf >> Of Iames Pizzoli >> Sent: 04 August 2009 10:32 >> To: Lista ProFox >> Subject: VFP9 SP2: Form caption strangeness >> >> Hi all, >> >> I hope someone can help me, 'cause this is driving me nuts! >> >> I have this grid, in AfterRowColChange event method the code is: >> >> --- >> LPARAMETERS nColIndex >> >> SET STEP ON >> >> LOCAL lcTableItemExpression, lcTableItem >> >> lcTableItemExpression = Thisform.icTableItemExpression >> >> IF VARTYPE( lcTableItemExpression) = "C" AND NOT EMPTY( >> lcTableItemExpression ) >> lcTableItem = EVALUATE( lcTableItemExpression ) >> >> lcTableItem = IIF( ISNULL( m.lcTableItem ), SPACE(0), ALLTRIM( >> lcTableItem >> ) ) >> ENDIF >> >> Thisform.Caption = lcTableItem <--- >> >> *Thisform.Refresh() >> >> DODEFAULT( nColIndex ) >> --- >> >> I can see in the debugger what lcTableItem becomes, and it correctly >> matches >> the value in the new row I'm, after the move from the previous row. >> Now, at >> the '<---' line I should see the form caption change accordingly, >> right? >> Well, it doesn't!!! It stays the same. I tried, out of despair, a >> form.Refresh(), as you can see, but no change. I can't see why it >> shouldn't >> work as it is. Any idea? >> >> TIA >> >> Iames >> >> >> >> -- >> Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e >> SMTP >> autenticato? GRATIS solo con Email.it http://www.email.it/f >> >> Sponsor: >> RIVIERA PARK HOTELS: >> * Cerchi un hotel per visitare i parchi della Romagna ? Oltremare, >> Aquafan, >> Mirabilandia e Fiabilandia ti aspettano. Scegli un RivieraParkHotels >> per la >> tua vacanza a Riccione. >> Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=9395&d=4-8 >> >> [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/a57fa4cf19531343a2ee11b57db8e3af04c...@server.peterhartcomputers.local ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

