Hi John,
Is the CreateReportCursor method always creating a table? Place a
set step on
in that method and use the debugger to walk through the code and see what it's doing. See what's in the ReportPreview cursor after the code runs, and also what is the value of _TALLY.
BTW if you use put a < pre > before and a < /pre > after you code the ut will save your formatting. See below:
LOCAL cGroupCode, cCompanyName, dStart, dEnd
WITH THISFORM
cGroupCode = .textbox1.VALUE
CcOMPANYnAME = .textbox2.VALUE
dStart = .text3.value
dend = textbox4.
ENDWITH
SELECT test.group_code, payment.ins_co_name, payment.fromdate, payment.todate;
FROM test, payment ;
WHERE test.group_code == cGroupCode ;
AND payment.ins_co_name == cCompanyName ;
AND payment.fromdate == dStart ;
AND payment.todate == dEnd ;
INTO Cursor ReportPreview
IF _TALLY != 0
cReturn = .T.
ELSE
cReturn = .F.
ENDIF
RETURN cReturn
>
>3. I then opened the form search1.
>4. I opened the add meathord option and added the meathord CreateReportCursor.
>5. I the opened the command button of my search button and added the foling code to the click event option.
> cResult = thisform.CreateReportCursor()
> if cResult
> wait window 'Cursor is there, do your preview'
> else
> wait window 'No records, notify the user'
> endif
>
>The problem is, no mater what I put in, it comes back with the wait window 'Cursor is there, do your preview' This happens even if theres no data entered.
>
>Please Help
>John
Roi
'MCP' Visual FoxPro
In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!