Karen,
BTW (TEXTVALUE) property can be tested ANYTIME for a value as that is what
is in the edit buffer before it is saved or field exited. Property (TEXT)
is what is in the buffer after save or during edit, prior to row exit.
Use a form timer set to 500 or so ms. In the form timer event put some code
to check whatever componenID in the form you wish. In my test, mine looks
like this.
SET VAR vtextval TEXT = NULL
GETPROPERTY dbevehicle textvalue vtextvalue
IF (SLEN(.vtextvalue)) > 0 OR vtextvalue IS NOT NULL THEN
PROPERTY dbevehicle color 'white'
ELSE
PROPERTY dbevehicle color 'red'
ENDIF
GETPROPERTY dbeexpdate textvalue vtextvalue
IF (SLEN(.vtextvalue)) > 0 OR vtextvalue IS NOT NULL THEN
PROPERTY dbeexpdate color 'white'
ELSE
PROPERTY dbeexpdate color 'red'
ENDIF
GETPROPERTY dbeamt textvalue vtextvalue
IF (SLEN(.vtextvalue)) > 0 OR vtextvalue IS NOT NULL THEN
PROPERTY dbeamt color 'white'
ELSE
PROPERTY dbeamt color 'red'
ENDIF
RETURN
My example used all three fields on the form. When a new row is entered,
the fields will be red, as soon as you begin typing in the edit field, the
color changes (in my example) to white.
You can perform data validation on exit from the row or put additional code
in the particular portion of the timer eep to check the data as it is
entered.
HTH
----- Original Message -----
From: <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, October 11, 2010 4:55 PM
Subject: [RBASE-L] - Re: A change in DBEdit color won't stick
Dawn: But I don't see the behavior you're explaining... The GETPROPERTY
was in my field "on exit" eep, and it does pick up the correct value. If
it
was null before, and now it isn't null, thru tracing I can see that the
getproperty retrieved my new not-null value into the variable. It gets to
the
code that changes the dbedit color based on the not-null value. So the
getproperty is working even though the data isn't "saved" yet, it changes
the
color of the field (as I can see in the background as I trace), but then
it
reverts back as soon as it landed in the next field.
Maybe this is symantics, but I'd really like to know this -- if the field
eep is "on exit", then you have left the field, right? You say it must be
done "after you've left the field". But wouldn't an exit eep be evaluated
after you've left the field? I don't think it's "as you are in the
process of
leaving the field"... Just wondering what your perception is compared to
mine.
Karen
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.