Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with the valid of a checkbox in a grid
Message
From
18/04/2008 15:33:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/04/2008 15:23:45
Chris Sund
Silhouette Solutions
Utah, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01311365
Message ID:
01311782
Views:
16
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform