> HDRFN6D="Salgh."> > THISFORMSET.Form11.Grid1.RecordSourceType = 4-Sql Statment> THISFORMSET.Form11.Grid1.RecordSource = ""> > SELE &HDRFN6D.prnt,invoice_no,subs(mrdminv_no,5,6)+subs(mrdminv_no,1,4) as mrdminv_no,&HDRFN6D.date,;> accbal2.accna,amtgrs,disc,expmnininv,amtnet,citmno,invtype,&HDRFN6D.acccd,;> trcna,btyno,crtn,bndl,dsptchdby,&HDRFN6D.clkdate,ccna,ccrno,ccrdt,;> tnr,inat,usrno__,;> subs(mrdminv_no,1,4)+str(val(subs(mrdminv_no,5,6))) as mrdmno_val,;> subs(&HDRFN6D.acccd,6,3)+accbal2.accna AS code_alpha_name,;> o_chgs,&HDRFN6D.dscptg,btydt,btyexp,prtclar;> FROM FORCE &HDRFN6 ;> LEFT JOIN ACCBAL2 ;> ON &HDRFN6D.ACCCD = ACCBAL2.ACCCD ;> WHERE NOT DELETED() ;> ORDER BY &ORDRBY7 INTO CURSOR tc_hdr_vw READWRITE > > THISFORMSET.Form11.Grid1.RecordSource = "tc_hdr_vw"> > There are records in temporary cursor "tc_hdr_vw" no problem in cursor but records are not populating in the Grid from that cursor with given above settings of Grid

Khurram,

Take a look at your previous post. Andy has given you what you need. When you issue

ThisFormSet.Form1.Grid1.RecordSource = ""

you erase the recordsource and this is what will give you problems. Use CREATE CURSOR to create a cursor called GridCursor with the same structure as the cursor created with your SELECT statement. (Do this in the form's .Load()) Now, set the grid's RecordSourceType to 1 and the .Recordsource to "GridCursor."Now create a custom form method .RepopulateGrid() In this method, issue the following