preventing repeat records 
Author Message
 preventing repeat records

Hi there,
    we have an interesting problem. I want to prevent certain records in a
dataset (TQuery) from showing up in a report. I also do not  want them to be
included in any sum calculations. Adding a field in the database to
distinguish these records is not really an option right now, so I'm trying a
coding solution. Do you guys have any ideas?  I did attempt putting a
conditional Next in the AfterScroll event of the TQuery object, but it
seemed to corrupt/mixup the dataset pointers because I was getting
unexpected results (wrong record skipped and another record repeated). My
theory was probably flawed because I was causing event recursion. Anyhow, do
you guys know how to do this? Any advice would be appreciated. Thank you,

    Steve Anderson



Wed, 18 Jun 1902 08:00:00 GMT
 preventing repeat records

Have you considered using a filter, (either the Filter property or the
OnFilterRecord event)? You can use the Filtered property to turn the
filtering on and off.


Quote:
> Hi there,
>     we have an interesting problem. I want to prevent certain records in a
> dataset (TQuery) from showing up in a report. I also do not  want them to
be
> included in any sum calculations. Adding a field in the database to
> distinguish these records is not really an option right now, so I'm trying
a
> coding solution. Do you guys have any ideas?  I did attempt putting a
> conditional Next in the AfterScroll event of the TQuery object, but it
> seemed to corrupt/mixup the dataset pointers because I was getting
> unexpected results (wrong record skipped and another record repeated). My
> theory was probably flawed because I was causing event recursion. Anyhow,
do
> you guys know how to do this? Any advice would be appreciated. Thank you,

>     Steve Anderson




Wed, 18 Jun 1902 08:00:00 GMT
 preventing repeat records
Thanks for the tip, worked great, no more wierd pointer corruptions.

    Steve


Quote:
> Have you considered using a filter, (either the Filter property or the
> OnFilterRecord event)? You can use the Filtered property to turn the
> filtering on and off.



> > Hi there,
> >     we have an interesting problem. I want to prevent certain records in
a
> > dataset (TQuery) from showing up in a report. I also do not  want them
to
> be
> > included in any sum calculations. Adding a field in the database to
> > distinguish these records is not really an option right now, so I'm
trying
> a
> > coding solution. Do you guys have any ideas?  I did attempt putting a
> > conditional Next in the AfterScroll event of the TQuery object, but it
> > seemed to corrupt/mixup the dataset pointers because I was getting
> > unexpected results (wrong record skipped and another record repeated).
My
> > theory was probably flawed because I was causing event recursion.
Anyhow,
> do
> > you guys know how to do this? Any advice would be appreciated. Thank
you,

> >     Steve Anderson




Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Prevent order_header record without order_detail record

2. Repeating and Non-Repeating

3. How2 repeat form field value in new record

4. SQL Statement for repeated records.

5. Showing related records in a repeating field?

6. Sort repeating records

7. Summarizing Repeating Fields from many records?

8. Producing Repeated Records

9. Split repeating fields to seperate FIELDS (not records)

10. Repeated Records

11. Convert various records into one repeating field

12. Looking for records with repeated data


 
Powered by phpBB® Forum Software