Main Program
with _screen
.visible = .f.
.caption = "South Dakota Geological Survey"
.windowstate = 2
.visible = .t.
endwith
set sysmenu off
set century on
set deleted on
close database all
*!* *!* * development database
open database V:\Lab_Transfer\db\wq shared
set default to V:\Lab_Transfer\search
* production database
*!*open database v:\wqdb\db\wq shared
*!*set default to c:\sdgs\wq_search
use wqhead alias wqhead in 0 shared
use wqfield alias wqfield in 0 shared
use wqinorg alias wqinorg in 0 shared
use wqorg alias wqorg in 0 shared
use wqpest alias wqpest in 0 shared
use wqiso alias wqiso in 0 shared
on shutdown do pgms\bye.prg
do form forms\frmQuery
read events
Form Query is an query form that asks for the field to be searched, and the criteria, when search is clicked it calls...rpt_selection
Code for Search User Procedure
Field1 = alltrim(upper(thisform.cboField1.value))
Text1 = upper(alltrim(thisform.txtField1.value))
Field2 = upper(alltrim(thisform.cboField2.value))
Text2 = alltrim(upper(thisform.txtField2.value))
SearchType = "" && SIMPLE, AND, OR, BETWEEN depending on option selected.
if(Field1 == ""

messagebox('No search criteria entered.', 48, 'Search Criteria Error')
this.parent.cboField1.setfocus
else
if(Text1 == ""

messagebox('Please enter a search term.', 48, 'Search Criteria Error')
this.parent.txtField1.setfocus
else
if (Field2 == "" AND (thisform.opgBoolean.optOr.value == 1 OR thisform.opgBoolean.optAnd.value == 1 OR ;
thisform.opgBoolean.optBetween.value == 1))
messagebox('Please select another field to search or change the search to SIMPLE.', 48, 'Search Criteria Error')
this.parent.cboField2.setfocus
else
if(Text2 == "" AND NOT Field2 == ""

messagebox('Please enter a second search term.', 48, 'Search Criteria Error')
this.parent.txtField2.setfocus
else
if(thisform.opgBoolean.optSimple.value == 1)
SearchType = "SIMPLE"
else
if(thisform.opgBoolean.optOr.value == 1)
SearchType = "OR"
else
if(thisform.opgBoolean.optAnd.value == 1)
SearchType = "AND"
else
if(thisform.opgBoolean.optBetween.value == 1)
SearchType = "BETWEEN"
endif
endif
endif
endif
thisform.visible = .f.
do pgms\reset_form.prg with thisform
do form forms\rpt_selection.scx with ;
Field1, Text1, Field2, Text2, SearchType
endif
endif
endif
endif
Code for rpt_selection - basically asks if edit version or final version....
Field1 = thisform.txtField1.value
Field2 = thisform.txtField2.value
Text1 = thisform.txtText1.value
Text2 = thisform.txtText2.value
SearchType = thisform.txtSearchType.value
* Field1 is the field used in the top portion of the query
* Text1 is the top search criteria
* Field2 is the field used in the bottom portion of the query
* Text2 is the bottom search criteria
* SearchType is type of search selected by user (SIMPLE, AND, OR, BETWEEN)
Table1 = ""
Table2 = ""
InorgRecCount = 0 && number of records returned from wqinorg
OrgRecCount = 0 && number of records returned from wqprg
IsoRecCount = 0 && number of records returned from wqiso
PestRecCount = 0 && number of records returned from wqpest
if(Field2 == "SECTION_LIST"

section1 = substr(Text2, 1, 2)
section2 = substr(Text2, 3, 2)
section3 = substr(Text2, 5, 2)
section4 = substr(Text2, 7, 2)
section5 = substr(Text2, 9, 2)
section6 = substr(Text2, 11, 2)
section7 = substr(Text2, 13, 2)
section8 = substr(Text2, 15, 2)
else
if(Field2 == "SECTION_RANGE"

sectionR1 = substr(Text2, 1, 2)
sectionR2 = substr(Text2, 3, 2)
endif
endif
if (Field1 == "COLLECTION_DATE" OR Field1 == "PROJECT_MANAGER" OR ;
Field1 == "PROJECT_NAME" OR Field1 == "SAMPLE_NUMBER"

Table1 = "WQFIELD"
else
Table1 = "WQHEAD"
endif
if (Field2 == "COLLECTION_DATE" OR Field2 == "ENTRY_DATE" OR ;
Field2 == "PROJECT_NAME" OR Field2 == "SAMPLE_NUMBER"

Table2 = "WQFIELD"
else
Table2 = "WQHEAD"
endif
* TOP QUERY
* perform queries for 'SIMPLE', 'AND', 'OR'
if(SearchType == "SIMPLE" OR SearchType == "AND" OR SearchType == "OR"

if(Field1 != "COLLECTION_DATE"

* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where &Table1..&Field1 like "%" + Text1 + "%" ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpTopInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where &Table1..&Field1 like "%" + Text1 + "%" ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpTopOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where &Table1..&Field1 like "%" + Text1 + "%" ;
AND (NOT wqpest.primary_lab_pesticide like "" ;
OR NOT primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpTopPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where &Table1..&Field1 like "%" + Text1 + "%" ;
AND NOT radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpTopIso
else && Field1 == "COLLECTION_DATE"
* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where wqfield.collection_date == ctod(Text1) ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpTopInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where wqfield.collection_date == ctod(Text1) ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpTopOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where wqfield.collection_date == ctod(Text1) ;
AND (NOT wqpest.primary_lab_pesticide like "" ;
OR NOT primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpTopPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where wqfield.collection_date == ctod(Text1) ;
AND NOT radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpTopIso
endif
else && perform queries for 'BETWEEN'
if(Field1 != "COLLECTION_DATE"

* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where &Table1..&Field1 between Text1 AND Text2 ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpTopInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where &Table1..&Field1 between Text1 AND Text2 ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpTopOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where &Table1..&Field1 between Text1 AND Text2 ;
AND (NOT primary_lab_pesticide like "" ;
OR NOT primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpTopPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where &Table1..&Field1 between Text1 AND Text2 ;
AND NOT radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpTopIso
else && Field1 == "COLLECTION_DATE"
* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where wqfield.collection_date between ctod(Text1) AND ctod(Text2) ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpTopInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where wqfield.collection_date between ctod(Text1) AND ctod(Text2) ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpTopOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where wqfield.collection_date between ctod(Text1) AND ctod(Text2) ;
AND (NOT primary_lab_pesticide like "" ;
OR NOT primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpTopPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where wqfield.collection_date between ctod(Text1) AND ctod(Text2) ;
AND NOT radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpTopIso
endif
endif
* BOTTOM QUERY
if(Field2 == "" OR SearchType == "BETWEEN"

* do nothing
else
if(Field2 != "COLLECTION_DATE" AND Field2 != "ENTRY_DATE" AND ;
Field2 != "SECTION_LIST" AND Field2 != "SECTION_RANGE"

* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where &Table2..&Field2 like "%" + Text2 + "%" ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpBottomInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where &Table2..&Field2 like "%" + Text2 + "%" ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpBottomOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where &Table2..&Field2 like "%" + Text2 + "%" ;
AND (NOT wqpest.primary_lab_pesticide like "" ;
OR NOT wqpest.primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpBottomPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where &Table2..&Field2 like "%" + Text2 + "%" ;
AND NOT wqiso.radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpBottomIso
else
if(Field2 == "ENTRY_DATE" OR Field2 == "COLLECTION_DATE"

* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where &Table2..&Field2 == ctod(Text2) ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpBottomInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where &Table2..&Field2 == ctod(Text2) ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpBottomOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where &Table2..&Field2 == ctod(Text2) ;
AND (NOT wqpest.primary_lab_pesticide like "" ;
OR NOT wqpest.primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpBottomPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where &Table2..&Field2 == ctod(Text2) ;
AND NOT wqiso.radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpBottomIso
else
if(Field2 == "SECTION_LIST"

* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where (substr(alltrim(wqhead.location), 8, 2) == section1 ;
OR substr(alltrim(wqhead.location), 8, 2) == section2 ;
OR substr(alltrim(wqhead.location), 8, 2) == section3 ;
OR substr(alltrim(wqhead.location), 8, 2) == section4 ;
OR substr(alltrim(wqhead.location), 8, 2) == section5 ;
OR substr(alltrim(wqhead.location), 8, 2) == section6 ;
OR substr(alltrim(wqhead.location), 8, 2) == section7 ;
OR substr(alltrim(wqhead.location), 8, 2) == section8) ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpBottomInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where (substr(alltrim(wqhead.location), 8, 2) == section1 ;
OR substr(alltrim(wqhead.location), 8, 2) == section2 ;
OR substr(alltrim(wqhead.location), 8, 2) == section3 ;
OR substr(alltrim(wqhead.location), 8, 2) == section4 ;
OR substr(alltrim(wqhead.location), 8, 2) == section5 ;
OR substr(alltrim(wqhead.location), 8, 2) == section6 ;
OR substr(alltrim(wqhead.location), 8, 2) == section7 ;
OR substr(alltrim(wqhead.location), 8, 2) == section8) ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpBottomOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where (substr(alltrim(wqhead.location), 8, 2) == section1 ;
OR substr(alltrim(wqhead.location), 8, 2) == section2 ;
OR substr(alltrim(wqhead.location), 8, 2) == section3 ;
OR substr(alltrim(wqhead.location), 8, 2) == section4 ;
OR substr(alltrim(wqhead.location), 8, 2) == section5 ;
OR substr(alltrim(wqhead.location), 8, 2) == section6 ;
OR substr(alltrim(wqhead.location), 8, 2) == section7 ;
OR substr(alltrim(wqhead.location), 8, 2) == section8) ;
AND (NOT wqpest.primary_lab_pesticide like "" ;
OR NOT wqpest.primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpBottomPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where (substr(alltrim(wqhead.location), 8, 2) == section1 ;
OR substr(alltrim(wqhead.location), 8, 2) == section2 ;
OR substr(alltrim(wqhead.location), 8, 2) == section3 ;
OR substr(alltrim(wqhead.location), 8, 2) == section4 ;
OR substr(alltrim(wqhead.location), 8, 2) == section5 ;
OR substr(alltrim(wqhead.location), 8, 2) == section6 ;
OR substr(alltrim(wqhead.location), 8, 2) == section7 ;
OR substr(alltrim(wqhead.location), 8, 2) == section8) ;
AND NOT wqiso.radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpBottomIso
else && Field2 == "SECTION_RANGE"
* inorganic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqinorg ;
where substr(alltrim(wqhead.location), 8, 2) between sectionR1 and sectionR2 ;
AND NOT lab_inorganic like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqinorg.sample_number ;
into cursor tmpBottomInorg
* organic
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqorg ;
where substr(alltrim(wqhead.location), 8, 2) between sectionR1 and sectionR2 ;
AND NOT lab_voc like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqorg.sample_number ;
into cursor tmpBottomOrg
* pesticide
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqpest ;
where substr(alltrim(wqhead.location), 8, 2) between sectionR1 and sectionR2 ;
AND (NOT wqpest.primary_lab_pesticide like "" ;
OR NOT wqpest.primary_lab_immunoassay like ""

;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqpest.sample_number ;
into cursor tmpBottomPest
* isotope
select wqhead.location as loc, ;
wqfield.sample_number as sample__number, * ;
from wqhead, wqfield, wqiso ;
where substr(alltrim(wqhead.location), 8, 2) between sectionR1 and sectionR2 ;
AND NOT wqiso.radionuclide_lab like "" ;
AND wqhead.location = wqfield.location ;
AND wqfield.sample_number = wqiso.sample_number ;
into cursor tmpBottomIso
endif
endif
endif
endif
* Now, combine cursors tmpTopInorg, tmpBottomInorg, tmpTopPest,
* tmpBottomPest, tmpTopIso, tmpBottomIso and tmpTopOrg, tmpBottomOrg
* using 'SIMPLE, 'AND', 'OR' cases
do case
case (SearchType == "SIMPLE"
* wqinorg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopInorg ;
into cursor csrInorg ;
order by loc, sample__number
InorgRecCount = _tally
* wqorg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopOrg ;
into cursor csrOrg ;
order by loc, sample__number
OrgRecCount = _tally
* wqpest
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopPest ;
into cursor csrPest ;
order by loc, sample__number
PestRecCount = _tally
* wqiso
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopIso ;
into cursor csrIso ;
order by loc, sample__number
IsoRecCount = _tally
case (SearchType == "AND"

* wqinorg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpTopInorg ;
where sample__number in ;
(select sample__number from tmpBottomInorg) ;
into cursor csrInorg ;
order by loc, sample__number
InorgRecCount = _tally
* wqorg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpTopOrg ;
where sample__number in ;
(select sample__number from tmpBottomOrg) ;
into cursor csrOrg ;
order by loc, sample__number
OrgRecCount = _tally
* wqpest
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpTopPest ;
where sample__number in ;
(select sample__number from tmpBottomPest) ;
into cursor csrPest ;
order by loc, sample__number ASC
PestRecCount = _tally
* wqiso
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpTopIso ;
where sample__number in ;
(select sample__number from tmpBottomIso) ;
into cursor csrIso ;
order by loc, sample__number
IsoRecCount = _tally
case (SearchType == "OR"

* wqinorg
select * from tmpTopInorg ;
union ;
(select * from tmpBottomInorg) ;
into cursor tmpInorg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpInorg ;
into cursor csrInorg ;
order by loc, sample__number
InorgRecCount = _tally
* wqorg
select * from tmpTopOrg ;
union ;
(select * from tmpBottomOrg) ;
into cursor tmpOrg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpOrg ;
into cursor csrOrg ;
order by loc, sample__number
OrgRecCount = _tally
* wqpest
select * from tmpTopPest ;
union ;
(select * from tmpBottomPest) ;
into cursor tmpPest
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpPest ;
into cursor csrPest ;
order by loc, sample__number
PestRecCount = _tally
* wqiso
select * from tmpTopIso ;
union ;
(select * from tmpBottomIso) ;
into cursor tmpIso
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * from tmpIso ;
into cursor csrIso ;
order by loc, sample__number
IsoRecCount = _tally
case (SearchType == "BETWEEN"

* wqinorg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopInorg ;
into cursor csrInorg ;
order by loc, sample__number
InorgRecCount = _tally
* wqorg
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopOrg ;
into cursor csrOrg ;
order by loc, sample__number
OrgRecCount = _tally
* wqpest
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopPest ;
into cursor csrPest ;
order by loc, sample__number
PestRecCount = _tally
* wqiso
select recno() as RecNo1, recno() as RecNo2, ;
recno() as RecNo3, * ;
from tmpTopIso ;
into cursor csrIso ;
order by loc, sample__number
IsoRecCount = _tally
endcase
thisform.visible = .f.
thisform.release
if (InorgRecCount = 0 AND OrgRecCount = 0 AND IsoRecCount = 0 AND PestRecCount = 0)
messagebox('No records were found to match query.', 64, 'Query Results')
frmQuery.visible = .t.
else
do form forms\final_output_options.scx with ;
InorgRecCount, OrgRecCount, IsoRecCount, PestRecCount, ;
Field1, Text1, Field2, Text2, SearchType
endif
Which finaly calls the output version screen....
Which performs layout functionallity...
Browse the cursor, print preview, or print final....