Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two grids on a form
Message
De
25/11/2004 04:20:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
25/11/2004 01:13:26
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows '98
Database:
Visual FoxPro
Divers
Thread ID:
00964600
Message ID:
00964617
Vues:
7
>Hi all
>I have a form with two grid in it.( Grid1 and Grid2 ). i have a table with two field .( Field1 N(3,0) , Field2 L )
>I want to have records that Field2 = .T. in Grid1 and Field2 = .F. in Grid2
>Can i have this condition?

Yes and you can do it in more than one ways.
1) Simple one is to use SQL recordsourcetype and set grid Recordsource:
* True grid init
with this
 .RecordSourceType = 4 
 .RecordSource = "select field1, field2 from myTable where field2 into cursor crsTrue"
endwith

* False grid init
with this
 .RecordSourceType = 4 
 .RecordSource = "select field1, field2 from myTable where !field2 into cursor crsFalse"
endwith
2) If you have an index on logical field (not a good idea but for small tables this might be used here):

use myTable in 0 again alias TrueCase order tag Field2
use myTable in 0 again alias FalseCase order tag Field2
select TrueCase
set filter to Field2
select FalseCase
set filter to !Field2

grdTrue.recordsource = "TrueCase"
grdFalse.recordsource = "FalseCase"

There are other ways too but I think these 2 are easiest.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform