Yeah, I did a thread recently about that and I am still not getting this to work. I did even tried the DynamicBackColor (in the Save button below), it still didn't work...
VFP 6.0 (SP4)
The following codes are for the record-level validation (in the table):
FUNCTION authverfield
wait window "going thru the authverfield"
DO CASE
CASE ALLTRIM(UPPER(authtype)) = "VISA"
IF limit = 0 OR ;
EMPTY(fund) OR ISNULL(fund) OR ;
EMPTY(account)OR ISNULL(account) OR ;
EMPTY(program) OR ISNULL(program)
=Messagebox("The VISA must have :"+CHR(13)+ ;
"LIMIT, FUND, PROGRAM, and ACCOUNT",64,"Bad Data")
changebc = .T.
wait window "changebc = .T."
RETURN .F.
ENDIF
OTHERWISE
changebc = .F.
wait window "changebc = .F."
ENDCASE
ENDFUNC
The following codes are for the Grid:
* Authform Grid1 AfterRowColChange
LPARAMETERS nColIndex
ThisForm.nGridRecno = RECNO("auth")
This.Refresh()
* Authform Grid1 Init
ThisForm.SetAll("DynamicBackColor", ;
"IIF(RECNO('auth') =ThisForm.nGridRecno, RGB(193,255,255),"+ ;
"RGB(255,255,255))", "Column")
* Authform Grid1 Refresh
DODEFAULT()
The following codes are for the Save button:
* Authform SAVE ClickEvent
=TableUpdate(.T.)
IF changebc = .T.
wait window "should change color here"
ThisForm.SetAll("DynamicBackColor", ;
"IIF(RECNO('auth') =ThisForm.nGridRecno, RGB(255,255,255),"+ ;
"RGB(255,255,255))", "Column")
ThisForm.Grid1.Column6.Text1.BackColor = RGB(255,255,128)
ThisForm.Refresh
RETURN .F.
ENDIF
Sorry to post all those codes, but I do that to see if you may catch some of the errors. I have other errors too, but this one need to be working to solve the other errors. What I want to accomplish here is to get the SAVE button to work. That is, if there is a missing data in the field(s) (via, for VISA), I want to stop the blue row highlite (193,255,255) and highlite the specific FIELDs (not column or row) that are required (225,225,128 I only have one in the above in the SAVE button). Then after that, turn it back as it was before... the only reason I am trying to stop the blue row highlite is because if not, the regular backcolor would never show up, unless you can fix that otherwise. BTW, I did changed the Column6 to Sparse = .F.
Chuck
Today is tomorrow's yesterday.