Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor statement causing duplicate records in report
Message
From
04/06/2008 12:39:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Cursor statement causing duplicate records in report
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01321649
Message ID:
01321649
Views:
58
I am designing the last of the reports for this inventory program of mine (Never ending) I have a class for search form that is doing a date range from date to date and when I use the form with both comboboxes (username, strain) and fill out info it works great. But If I leave 1 combobox blank (no input) it will print duplicate or triplicate records.

With what little debug work I have done I am fairly lost, below is the code I am using for the form select records method
LPARAMETERS tcWhere
WAIT WINDOW NOWAIT 'Wait, please, while the records are selected...'

SELECT * from Trimm ;
WHERE &tcWhere ORDER BY UserID, Strain INTO CURSOR crsResults nofilter

IF RECCOUNT('crsResults') = 0
   =ErrorMsg("Your criteria didn't return any records...")
   RETURN 0
ENDIF

WAIT clear
PRIVATE cTitle
cTitle = "Help Desk Report for " + thisform.oSearchCollection.GetCriteriaInEnglish()
SELECT crsResults
REPORT FORM TrimUserTotalSXUserID TO PRINTER PROMPT preview
Any suggestions???

Thanks in advance.

Fred W.
Next
Reply
Map
View

Click here to load this message in the networking platform