>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:
with this
.RecordSourceType = 4
.RecordSource = "select field1, field2 from myTable where field2 into cursor crsTrue"
endwith
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