>Hi Cetin,
>
>I have one additional question. I've never used the 4-SQL Statement as the RecordSourceType. What do I define as the controlsource for my columns? Here's how I modified your example to fit my needs.
>
>
>
>
>* Init of Grid2
>
>DODEFAULT()
>
>
>* Get County List
>
>Create Cursor rcounties ;
> (ccounty_pk c (23),;
> lchoice l,;
> cname c (25),;
> cstate c (2))
>
> SELECT * FROM rcounties ORDER BY lchoice INTO CURSOR rcounties READWRITE
>
>
>SELECT * FROM data\counties WHERE ccounty_pk in(SELECT ccounty_fk FROM data\stxproperty) INTO CURSOR tinsert_county
>
>SCAN
>SCATTER NAME ocounty
>INSERT INTO rcounties(ccounty_pk,lchoice,cname,cstate) values(ocounty.ccounty_pk,.t.,ocounty.cname,ocounty.cstate)
>endscan
>
>
>
>
>
>
>this.RecordSourceType = 4
>text to this.RecordSource noshow pretext 15
>select * from rcounties
> where cstate in
> (select cstate_pk from rstates where lchoice)
> into cursor rcounties2
>ENDTEXT
>
>
>
>Here's Grid 1
>
>
>
>* InteractiveChange event of column1.Grid1
>
>DODEFAULT()
>
>this.Value = this.Value
>WITH thisform.pageframe1.page2.grid2
> .RecordSource = .Recordsource
> .SetFocus()
>ENDWITH
>this.SetFocus()
>
>
>
>Everything works beautifully but I need to point the columns of Grid2 to the proper data info in my SQL statement. I tried setting them to rcounties2.lchoice,rcounties2.cstate, rcounties2.cname, but it didn't work. I'm sure there's a different way to do this when using a RecordSourceType of 4. I've been looking for some info on the controlsource, but I haven't found anything yet. If I do I will reply back to this thread.
>
>Many Thanks!
>
>Chris
select fieldName1, fieldName2 ... from ...
PS: You don't need to create a cursor and populate it. Directly use the SQL to get that data.
SELECT * FROM data\counties WHERE ccounty_pk in(SELECT ccounty_fk FROM data\stxproperty) INTO CURSOR tinsert_countycursorforgrid
Cetin