* Code for Text Box .Valid() for Operator - Numeric key val - the problem * _________________ LOCAL lcExactSet lcExactSet = SET( "Exact") Set Exact Off If not INDEXSEEK( This.Value, .T., "OPERATOR", "CODE") && If not find this Operator no in Operators table = MESSAGEBOX( "Sorry, Operator " + ALLTRIM( STR( This.Value)) + " does not exist.", ; MB_ICONSTOP, "Operator does not exist") With Thisform .cmdPreview.enabled = .F. .cmdPrint.enabled = .F. EndWith Else With Thisform With .cboOperators * For Now>.Requery() && Cos didn't work WITH it .Value = This.value EndWith If .lValidStart; and .lValidEnd .cmdPreview.enabled = .T. .cmdPrint.enabled = .T. EndIf EndWith Endif Set Exact &lcExactSet
* Code for Text Box .Valid() for Family - Char data - OK * _________________ LOCAL lcExactSet lcExactSet = SET( "Exact") Set Exact On If not INDEXSEEK( ALLTRIM( This.Value), .T., "FAMILY", "CODE") && If not find this Family no in Family table = MESSAGEBOX( "Sorry, Family " + ALLTRIM( This.Value) + " does not exist.", ; MB_ICONSTOP, "Family does not exist") With Thisform .cmdPreview.enabled = .F. .cmdPrint.enabled = .F. EndWith Else With Thisform With .cboFamilies .Requery() .Value = This.value EndWith If .lValidStart; and .lValidEnd .cmdPreview.enabled = .T. .cmdPrint.enabled = .T. EndIf EndWith Endif Set Exact &lcExactSet