Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor statement causing duplicate records in report
Message
 
 
To
04/06/2008 12:39:54
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01321649
Message ID:
01321650
Views:
13
>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
For test purpose add here

Messagebox (m.tcWhere)
>PRIVATE cTitle
>cTitle = "Help Desk Report for " + thisform.oSearchCollection.GetCriteriaInEnglish()
First of all, change cTitle here (or you're probably don't use the cTitle in your report, comment this line out).
>SELECT crsResults
Add here

Browse && To see what's inside

>REPORT FORM TrimUserTotalSXUserID TO PRINTER PROMPT preview
>
>
>Any suggestions???
>
>Thanks in advance.
>
>Fred W.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform