* Set select fields to blank so that all records are selected lcselfield1 = "" lcselfield2 = "" * If check boxes are ticked on screen, change select fields accordingly IF THISFORM.ChkBox8.VALUE = 1 IF EMPTY(THISFORM.txtcustid.VALUE) lcselfield1 = " " ELSE lcselfield1 = EVALUATE('Thisform.Txtcustid.Value') ENDIF ENDIF IF THISFORM.ChkBox9.VALUE = 1 lcselfield2 = EVALUATE('Thisform.cbocyear.value') + EVALUATE('Thisform.cbocmonth.value') ENDIF SELECT Contacts.* ; FROM Contacts ; WHERE Contacts.Custid = lcselfield1 ; AND Contacts.titlemonth = lcselfield2 ; ORDER BY Contacts.lastname, Contacts.firstname ; INTO TABLE(lcfullname1)