Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Data not populating in the grid from cursor
Thread ID: 104418 Message ID: 104445 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Wednesday, August 16, 2006 3:09:31 PM         
   


> 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
SELECT &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 
SELECT GridCursor
ZAP
APPEND FROM tc_hdr_vw
WITH ThisForm.MyGrid
   .SetFocus()
   .Refresh()
ENDWITH


Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Data not populating in the grid from cursor Posted by Khurram Tahir @ 8/16/2006 12:37:55 PM
RE: Data not populating in the grid from cursor Posted by Mustapha Bihmouten @ 8/16/2006 12:58:07 PM
RE: Data not populating in the grid from cursor Posted by Khurram Tahir @ 8/16/2006 1:17:12 PM
RE: Data not populating in the grid from cursor Posted by Barbara Peisch @ 8/16/2006 7:54:11 PM
RE: Data not populating in the grid from cursor Posted by Ken Murphy @ 8/16/2006 3:09:31 PM
RE: Data not populating in the grid from cursor Posted by Jorge Angulo @ 4/9/2007 8:39:14 PM
RE: Data not populating in the grid from cursor Posted by Jorge Angulo @ 4/9/2007 8:39:20 PM
RE: Data not populating in the grid from cursor Posted by Ken Murphy @ 4/9/2007 8:45:43 PM
RE: Data not populating in the grid from cursor Posted by Jorge Angulo @ 4/10/2007 12:12:00 AM