I used the quotes in mine.

The difference is, Albert in your example, you're selecting data from the 
table.  Karen is controlling the color based on data not yet saved to the 
table.  The only way to gather it is by setting a form variable, or using 
GETPROPERTY.  Using GETPROPERTY must be done AFTER you've left the field, so it 
cannot be done in the on exit eep for that field, but rather in the on entry 
eep for the next.

Karen, if you don't have too many fields that need controlling, you could 
create a custom form action that evaluates all of them and sets the color 
appropriately.  Then on each object, on entry or on click, call the custom form 
action.  That way it doesn't matter if they click wherever and don't follow the 
tab order.  It would get slow I imagine if you have a lot of fields....


Dawn Hast | Evergreen Packaging | 175 Main Street, Canton, NC 28716 | Office 
(828) 646-2669 | Cell (828) 246-8543 | [email protected]


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Albert Berry
Sent: Monday, October 11, 2010 3:24 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: A change in DBEdit color won't stick

  Karen, I just noticed that R:Docs shows the variable name quoted in the 
GETPROPERTY command syntax.
GETPROPERTY orxunit TEXTVALUE *'vText'*
I would expect that it either works or it does not, but one never knows!

Albert
On 11/10/2010 11:58 AM, Albert Berry wrote:
>  It worked when I put a similar on an INTEGER field. Here is the 
> actual code where I test the invoice number. I tabbed out of the 
> field, and the white stuck after I entered a valid invoice number. I 
> have a form variable set to fInvNo = ReceiptsInvNo - maybe that is 
> another way of doing it that works.
>
> Albert
>
> SELECT COUNT(*) INTO fCount FROM Invoices WHERE InvNo = .fInvNo IF 
> fCount = 0 THEN
>     PROPERTY cReceiptsInvNo COLOR "RED"
>     PAUSE 1 USING "Invalid Invoice Number - Please Check Again" +
>       CAPTION "OOOPS!" +
>       AT CENTER CENTER
>     PROPERTY cReceiptsInvNo set_focus "True"
>     GOTO Stop
>   ELSE
>     PROPERTY cReceiptsInvNo COLOR "WHITE"
> ENDIF
>
>
> On 11/10/2010 10:22 AM, [email protected] wrote:
>> Using 7.6.  I want a field to have a red background if it is empty, 
>> white if it is filled in.  In the "on form after start eep", this 
>> works perfectly.  I cannot test the value itself because I have "set 
>> zero on" so a variable evaluates as 0 even if empty:
>>
>>     SET VAR vText TEXT = NULL
>>     GETPROPERTY orxunit TEXTVALUE vText
>>     IF vText IS NULL THEN
>>       PROPERTY orxunit COLOR 'RED'
>>     ELSE
>>       PROPERTY orxunit COLOR 'WHITE'
>>     ENDIF
>>
>> The next thing I want to do is to change the color to white if they 
>> type something in the field.  I tried putting the same code in the 
>> "after exit" eep of the field, with pause messages to make sure it's 
>> evaluating properly, and even though it figured it out right it won't 
>> keep the white color.  If I trace thru the code, I can see the field 
>> changing to white while I am in trace mode, but as soon as the trace 
>> is over and it goes to the next field, the color pops back to red.
>> Is there a way I can force it to "keep" that white color?   As a test 
>> I put the same code on entry into the next field, but the white 
>> refuses to stick.  Shouldn't this work?
>>
>> Karen
>
>
>


DISCLAIMER: This electronic message together with any attachments is 
confidential. If you are not the intended recipient, do not copy, disclose or 
use the contents in any way. Please also advise us by return e-mail that you 
have received the message and then please destroy. Evergreen Packaging is not 
responsible for any changes made to this message and / or any attachments after 
sending by Evergreen Packaging. We use virus scanning software but exclude all 
liability for viruses or anything similar in this email or any attachment.


Reply via email to