SET ENGINEBEHAVIOR 70 thisform.olecontrol1.Visible=.t. thisform.grid1.Visible=.f. LOCAL ldStart ldStart = thisform.text1.value ************************************* LOCATE FOR ldStart=dat&&&& bad thinking IF FOUND() ********************************** SELECT nam,amount,bank,sheqno,dat,tra, SUM(amount) AS bill_total FROM Mstr ; WHERE dat= ldStart ; GROUP BY nam,amount,bank,sheqno,dat ; ORDER BY sheqno INTO CURSOR qTmp SELECT csrBillTotals ZAP APPEND FROM DBF( [qTmp] ) go top SELECT csrBillTotals ZAP APPEND FROM DBF( [qTmp] ) Thisform.refresh() * thisform.grid1.column1.header1.forecolor='255,255,0' thisform.grid1.column1.header1.caption="ÊÇÑíÎ ÇáÔíß" thisform.grid1.column1.header1.fontsize=12 thisform.grid1.column1.WIDTH=88 thisform.grid1.column1.header1.fontbold=.t. thisform.grid1.column1.Alignment = 2 backcolor="128,128,255" thisform.grid1.column2.header1.caption="ÑÞã ÇáÔíß" thisform.grid1.column2.header1.fontsize=12 thisform.grid1.column2.WIDTH=88 thisform.grid1.column2.header1.fontbold=.t. thisform.grid1.column2.Alignment = 2 backcolor="128,128,255" thisform.grid1.column3.header1.caption="ãÓÍæÈ Úáì" thisform.grid1.column3.header1.fontsize=12 thisform.grid1.column3.WIDTH=88 thisform.grid1.column3.header1.fontbold=.t. thisform.grid1.column3.Alignment = 2 backcolor="128,128,255" thisform.grid1.column4.header1.caption="ÞíãÉ ÇáÔíß" thisform.grid1.column4.header1.fontsize=12 thisform.grid1.column4.WIDTH=88 thisform.grid1.column4.header1.fontbold=.t. thisform.grid1.column4.Alignment = 2 backcolor="128,128,255" thisform.grid1.column5.header1.caption="ÇÓã ÇáãÓÊÝíÏ" thisform.grid1.column5.header1.fontsize=12 thisform.grid1.column5.WIDTH=120 thisform.grid1.column5.header1.fontbold=.t. thisform.grid1.column5.Alignment = 2 backcolor="128,128,255" else thisform.grid1.Visible=.f. endif