Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Select sql and grid
Thread ID: 104345 Message ID: 104368 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Tuesday, August 15, 2006 5:33:31 PM         
   


change columncount of grid to -1 for automatically getting the columns (all fields in the cursor will be included and header captions will be field names) or after the select statement setup all the columns again with
mygrid.columncount=
mygrid.column1.controlsource=
mygrid.column1.header1.caption=
...



> > > HDRFN6D="Salgh."
> > >
> > > I have created a grid and its properties about table are as follows
> > >
> > > recordsource = "tc_hdr_vw"
> > > recordsourcetype = "1-Alias"
> > >
> > > 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
> > >
> > > After running this command Grid vanishes
> > >
> > > What are the proper commands if i want to show cursor in a grid

> >
> > The reason is that running a query closes the cursor - this means that the grid's recordsource disappears and is not restored. For the correct way to do this, see my blog article here:
> >
> > here
> >
> >
> > Regards
> > Andy Kramek
> > Microsoft MVP (Visual FoxPro)
> > Tightline Computers Inc, Akron Ohio, USA

>
> I have read your blog very carefully but there is something problem else i have tried by your way
>
> but when i set the following property
>
> THISFORMSET.Form11.Grid1.RecordSource = ""
>
> Then above Sql statement
>
> then
>
> THISFORMSET.Form11.Grid1.RecordSource = "tc_hdr_vw"
>
> but the following property is showing like the following
>
> THISFORMSET.Form11.Grid1.Column1.ControlSource = ""
>
> the above property i have set like this
>
> THISFORMSET.Form11.Grid1.Column1.ControlSource = "tc_hdr_vw.prnt"


ENTIRE THREAD

Select sql and grid Posted by Khurram Tahir @ 8/15/2006 9:55:34 AM
RE: Select sql and grid Posted by Jojo Sabino @ 8/15/2006 10:03:40 AM
RE: Select sql and grid Posted by Khurram Tahir @ 8/15/2006 12:40:17 PM
RE: Select sql and grid Posted by Andy Kramek @ 8/15/2006 12:41:46 PM
RE: Select sql and grid Posted by Khurram Tahir @ 8/15/2006 1:28:59 PM
RE: Select sql and grid Posted by tushar @ 8/15/2006 5:33:31 PM
RE: Select sql and grid Posted by Andy Kramek @ 8/16/2006 12:34:53 PM
RE: Select sql and grid Posted by Khurram Tahir @ 8/16/2006 12:44:54 PM
RE: Select sql and grid Posted by tushar @ 8/16/2006 1:23:42 PM
RE: Select sql and grid Posted by Andy Kramek @ 8/17/2006 12:43:57 PM
RE: Select sql and grid Posted by Don Higgins @ 8/21/2006 6:25:33 PM