If This.Value = "AND" or This.Value = "OR" ThisForm.QueryAdd() EndIfThe .QueryAdd() method contains the following code:
*!* Verify that the row contains enough information If !ThisForm.VerifyRow() Return EndIf *!* Append blank record to curQuery Select curQuery Append BlankThe .VerifyRow() method contains the following code:
Local llRetVal, lcMsg *!* Inits llRetVal = .T. lcMsg = "" Select curQuery Go Bottom *!* Check to see if there is an AND/OR clause *!* present in the last record. *!* If not, display a message to the user and bail out If Empty(curQuery.AndOr) =MessageBox("AND/OR value is required for this action", 0,"Query builder") llRetVal = .F. RETURN llRetVal EndIf *!* Check to see that the minimum values are present *!* Minimum values include: Field, Operator & Value If Empty(curQuery.Field) or Empty(curQuery.Oper) or Empty(curQuery.Value) lcMsg = "The following columns require values:" + Chr(13) lcMsg = IIf(Empty(curQuery.Field), lcMsg + Chr(13) + "Field column", lcMsg) lcMsg = IIf(Empty(curQuery.Oper), lcMsg + Chr(13) + "Operator column", lcMsg) lcMsg = IIf(Empty(curQuery.Value), lcMsg + Chr(13) + "Value column", lcMsg) *!* Display error message to the user =MessageBox(lcMsg, 0, "Query Builder") llRetVal = .F. && Ensure the return value is correct EndIf Return llRetVal