SET EXCLUSIVE off SET DELETED ON SET DEFAULT TO U:\Data USE modacad SELECT modacad LOCAL lctotal, lcsample, lctechnical, lcseason, lcdept, lcdesigner IF thisform.combo1.DisplayValue = 'ALL' lcseason = ' and ' + 'modacad.key1=""' ELSE lcseason = ' and ' + 'modacad.key1=thisform.combo1.DisplayValue' ENDIF IF thisform.combo2.DisplayValue = 'ALL' lcdept = ' and ' + 'modacad.key2=""' ELSE lcdept = ' and ' + 'modacad.key2=thisform.combo2.DisplayValue' ENDIF IF thisform.combo3.DisplayValue = 'ALL' lcdesigner = ' and ' + 'modacad.moc014=""' ELSE lcdesigner = ' and ' + 'modacad.moc014=thisform.combo3.DisplayValue' ENDIF COUNT FOR modacad.key4='SAMPLE' &lcseason &lcdept &lcdesigner TO lcsample COUNT FOR modacad.key4='TECHNICAL' &lcseason &lcdept &lcdesigner TO lctechnical COUNT FOR modacad.key4<>'ZZZZ' &lcseason &lcdept &lcdesigner TO lctotal thisform.text1.Value = lcsample thisform.text2.Value = lctechnical thisform.text3.Value = lctotal thisform.text4.Value = lctotal - (lcsample + lctechnical)Many Thanks