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