Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor statement causing duplicate records in report
Message
From
04/06/2008 14:10:55
 
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:
01321669
Views:
11
>>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.
So now after rem out and add lines to code the the first window to pop up is VFP window with trim date etc and OK button after pressing OK then another window looks like a table or table view comes up and after you close the window then the report pops up. (The report is correct though no dup data)
I am only trying to make this work with 1 combobox at a time while the other can be blank or empty to be able to separate the reports into 2 sets

Thanks,

Fred W.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform