Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: chris smith
  Where is chris smith?
 Yorkshire CH CH
 Barbados
 chris smith
 To: Shawn Ottinger
  Where is Shawn Ottinger?
 Greeneville TN
 Tennessee - United States
 Shawn Ottinger
 Tags
Subject: RE: Grid Help
Thread ID: 748 Message ID: 764 # Views: 2 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Wednesday, June 13, 2001 2:54:37 PM         
   


> > > > > OK Im missing something here. I have used a grid before and things I think should work do not.
> > > > > First - I thought I could select SQL as recordsource type and type a sql statement in the recordsource. Not working
> > > > >
> > > > > Second- I used a table to store my data instead. If I use another select statement to change the data in my table, the grid automatically resets all properties. I have to create a new check box for one of the columns and change the headings name everytime the change is made. This doesn't seem like it should be necessary.
> > > > >
> > > > > My concept of the Grid control is evidently not very good. Does anyone have any ideas that could help my understanding of why this is happening. I have two books on my desk and niether seem to be any help.
> > > >
> > > Her it is
> > > SELECT seq,order_num,part_num,quantity,uom,date_requi,csba_name;
> > > ,alloy,gauge,width,length,run_rate,station,hours,fin;
> > > FROM sched;
> > > where station = this.value;
> > > into table C:\workstasched;
> > > ORDER BY Seq
> > >
> > > then workstasched is the recordsource.
> > >
> > > If I use SQL in the properties the data is displayed in the grid but I also get a brows window. Would into cursor solve this?
> > >
> > > I am also having trouble being able to change data after the first refresh. It sais control is readonly but readonly is T for the grid,column, and textbox
> > > Heeelp.
> > > > Are you placing "INTO CURSOR cursorname" at the end of the SQL-statement in the recordsource type property? Can you post your SQL statement please.
> > > >
> > > > smith
> > Hi Shawn
> > I am going to rock the boat so to speak....with some useless information.
> >
> > One of the things I love about grids is their simplicity and efficiency, provided use is made of relational expression options to present small extracts from the source at one time. Even on large data tables there is nothing to beat it in terms of network traffic.
> >
> > However if an SQL select statement is required because of the complex nature and structure of the data, then that would be best.
> >
> > When a table is the source none of the problems are encountered.
> >
> >
> > Regards
> > Ryss
>
>
> That is what I want to do. The problem is I am lost at the "relational expression options to present small extracts from the source at one time" Where can I learn more about these options? None of the books I have, have any useful information on grids. It seems they are talked about very generically. All I need to do is view a few of the records based on one field.

Try this
1. Set the recordsource type property of the grid to SQL statement
2. Place a command button on the form.
3. Place the following code in the click event of the form

thisform.grid1.recordsource = "SELECT seq,order_num,part_num,quantity,uom,date_requi,csba_name;
,alloy,gauge,width,length,run_rate,station,hours,fin;
FROM sched;
WHERE station = yourvalue;
INTO CURSOR testcursor;
ORDER BY Seq"
thisform.grid1.refresh

***N.B
***yourvalue should contain your query value
***the testcursor will be read-only
***I also like Ryss sugesstions use the table as the recordsource with recordsource type as alias
***and use the SET FILTER command to dispaly only what you want.

P.S If you want I can e-mail you a simple form and a table that would demo. both ways. Let me know.

smith

ENTIRE THREAD

Grid Help Posted by Shawn Ottinger @ 6/13/2001 9:41:05 AM
RE: Grid Help Posted by chris smith @ 6/13/2001 12:35:23 PM
RE: Grid Help Posted by Shawn Ottinger @ 6/13/2001 1:00:34 PM
RE: Grid Help Posted by Ryss Unger @ 6/13/2001 1:13:26 PM
RE: Grid Help Posted by Shawn Ottinger @ 6/13/2001 2:20:13 PM
RE: Grid Help Posted by chris smith @ 6/13/2001 2:54:37 PM
RE: Grid Help Posted by Shawn Ottinger @ 6/13/2001 3:07:26 PM
RE: Grid Help Posted by Ryss Unger @ 6/13/2001 4:01:19 PM
RE: Grid Help Posted by Shawn Ottinger @ 6/14/2001 7:17:07 AM