keepfoxing
Programmer
this is my code to print list if conditions are met and my problem is, it always give me the message: "There are no enrollees for this year level1".
i knew how to construct if then else if there are few conditions but this one makes me confused.
can anybody help me reconstruct my if then else code to a better approach..
tnx in advance..
i knew how to construct if then else if there are few conditions but this one makes me confused.
can anybody help me reconstruct my if then else code to a better approach..
tnx in advance..
Code:
SELECT stud_table
IF EMPTY(THISFORM.cmb_yr.DisplayValue) OR EMPTY(THISFORM.cmb_major.DisplayValue)
MESSAGEBOX("Please fill the fields required.",64,"Info")
THISFORM.cmb_yr.SetFocus
RETURN
ELSE
LOCATE FOR major=ALLTRIM(thisform.cmb_major.DisplayValue) AND yr=ALLTRIM(thisform.cmb_yr.DisplayValue)
IF FOUND()
...PREVIEW FOR major=ALLTRIM(thisform.cmb_major.DisplayValue) AND yr=ALLTRIM(thisform.cmb_yr.DisplayValue)
ELSE
MESSAGEBOX("There are no enrollees for this year level1",0,"No records found")
RETURN
ENDIF
ENDIF
*************************************************************
IF thisform.cmb_yr.DisplayValue="ALL YEAR LEVEL" AND thisform.cmb_major.DisplayValue="ALL MAJORS" THEN
REPORT FORM LOCFILE("C:\System\Reports\masterlist.frx") TO PRINT PROMPT PREVIEW IN WINDOW wPreview
ELSE
IF EMPTY(stud_table.id_no)
MESSAGEBOX("There are no enrollees yet.",0,"No records found")
RETURN
ENDIF
ENDIF
********************************************************
IF thisform.cmb_yr.DisplayValue="ALL YEAR LEVEL" AND thisform.cmb_major.DisplayValue <> "ALL MAJORS" THEN
LOCATE FOR major=ALLTRIM(thisform.cmb_major.DisplayValue)
IF FOUND()
REPORT FORM LOCFILE("C:\System\Reports\masterlist.frx") TO PRINT PROMPT PREVIEW FOR major=ALLTRIM(thisform.cmb_major.DisplayValue) IN WINDOW wPreview
ELSE
IF !FOUND()
MESSAGEBOX("There are no enrollees for this year level2",0,"No records found")
RETURN
ENDIF
ENDIF
ENDIF
********************************************************
IF thisform.cmb_major.DisplayValue="ALL MAJORS" AND thisform.cmb_yr.DisplayValue != "ALL YEAR LEVEL" THEN
LOCATE FOR yr=ALLTRIM(thisform.cmb_yr.DisplayValue)
IF FOUND()
REPORT FORM LOCFILE("C:\System\Reports\masterlist.frx") TO PRINT PROMPT PREVIEW FOR yr=ALLTRIM(thisform.cmb_yr.DisplayValue) IN WINDOW wPreview
ELSE
MESSAGEBOX("There are no enrollees for this year level3",0,"No records found")
RETURN
ENDIF
ENDIF
**************